Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align fork with HPU upstream code #465

Merged
merged 4 commits into from
Nov 6, 2024

Conversation

kzawora-intel
Copy link

@kzawora-intel kzawora-intel commented Nov 6, 2024

vllm-project#6143 got merged, but it's based on an older revision of HPU components. This PR aligns the two.

kzawora-intel and others added 2 commits November 6, 2024 01:09
…-project#6143)

Signed-off-by: yuwenzho <[email protected]>
Signed-off-by: Chendi.Xue <[email protected]>
Signed-off-by: Bob Zhu <[email protected]>
Signed-off-by: zehao-intel <[email protected]>
Signed-off-by: Konrad Zawora <[email protected]>
Co-authored-by: Kunshang Ji <[email protected]>
Co-authored-by: Sanju C Sudhakaran <[email protected]>
Co-authored-by: Michal Adamczyk <[email protected]>
Co-authored-by: Marceli Fylcek <[email protected]>
Co-authored-by: Himangshu Lahkar <[email protected]>
Co-authored-by: Vivek Goel <[email protected]>
Co-authored-by: yuwenzho <[email protected]>
Co-authored-by: Dominika Olszewska <[email protected]>
Co-authored-by: barak goldberg <[email protected]>
Co-authored-by: Michal Szutenberg <[email protected]>
Co-authored-by: Jan Kaniecki <[email protected]>
Co-authored-by: Agata Dobrzyniewicz <[email protected]>
Co-authored-by: Krzysztof Wisniewski <[email protected]>
Co-authored-by: Dudi Lester <[email protected]>
Co-authored-by: Ilia Taraban <[email protected]>
Co-authored-by: Chendi.Xue <[email protected]>
Co-authored-by: Michał Kuligowski <[email protected]>
Co-authored-by: Jakub Maksymczuk <[email protected]>
Co-authored-by: Tomasz Zielinski <[email protected]>
Co-authored-by: Sun Choi <[email protected]>
Co-authored-by: Iryna Boiko <[email protected]>
Co-authored-by: Bob Zhu <[email protected]>
Co-authored-by: hlin99 <[email protected]>
Co-authored-by: Zehao Huang <[email protected]>
Co-authored-by: Andrzej Kotłowski <[email protected]>
Co-authored-by: Yan Tomsinsky <[email protected]>
Co-authored-by: Nir David <[email protected]>
Co-authored-by: Yu-Zhou <[email protected]>
Co-authored-by: Ruheena Suhani Shaik <[email protected]>
Co-authored-by: Karol Damaszke <[email protected]>
Co-authored-by: Marcin Swiniarski <[email protected]>
Co-authored-by: Woosuk Kwon <[email protected]>
Co-authored-by: Jacek Czaja <[email protected]>
Co-authored-by: Jacek Czaja <[email protected]>
Co-authored-by: Yuan <[email protected]>
@kzawora-intel kzawora-intel marked this pull request as draft November 6, 2024 12:16
@@ -569,7 +569,8 @@
# This avoids race conditions with ray.
# see https://github.com/vllm-project/vllm/issues/8204
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(("", args.port))
sock.bind((args.host or "", args.port))

Check warning

Code scanning / CodeQL

Binding a socket to all network interfaces Medium

'' binds a socket to all interfaces.

Copilot Autofix AI 3 months ago

To fix the problem, we need to bind the socket to a specific network interface instead of all interfaces. This can be achieved by modifying the sock.bind call to use a specific IP address. The best way to do this without changing existing functionality is to use the IP address provided in the args.host parameter. If args.host is not provided, we should raise an error or use a default secure IP address.

  1. Modify the sock.bind call on line 572 to use args.host directly.
  2. Ensure that args.host is not an empty string or 0.0.0.0. If it is, raise an error or use a default secure IP address.
Suggested changeset 1
vllm/entrypoints/openai/api_server.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/vllm/entrypoints/openai/api_server.py b/vllm/entrypoints/openai/api_server.py
--- a/vllm/entrypoints/openai/api_server.py
+++ b/vllm/entrypoints/openai/api_server.py
@@ -571,3 +571,5 @@
     sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-    sock.bind((args.host or "", args.port))
+    if not args.host or args.host in ["", "0.0.0.0"]:
+        raise ValueError("Invalid host address. Please provide a specific IP address.")
+    sock.bind((args.host, args.port))
     sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
EOF
@@ -571,3 +571,5 @@
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind((args.host or "", args.port))
if not args.host or args.host in ["", "0.0.0.0"]:
raise ValueError("Invalid host address. Please provide a specific IP address.")
sock.bind((args.host, args.port))
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@kzawora-intel kzawora-intel force-pushed the private/kzawora/align_upstream branch from 15541b2 to 843ae37 Compare November 6, 2024 13:33
@kzawora-intel kzawora-intel marked this pull request as ready for review November 6, 2024 13:34
@michalkuligowski michalkuligowski merged commit 60b981e into habana_main Nov 6, 2024
9 checks passed
@michalkuligowski michalkuligowski deleted the private/kzawora/align_upstream branch November 6, 2024 13:44
@kzawora-intel kzawora-intel added the habana Issues or PRs submitted by Habana Labs label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
habana Issues or PRs submitted by Habana Labs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants