Skip to content
Merged

fix #1710

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions aiter/jit/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,15 @@ def validate_and_update_archs():
def hip_flag_checker(flag_hip: str) -> bool:
import subprocess

cmd = ["hipcc", flag_hip, "-x", "hip", "-E", "-P", "/dev/null", "-o", "/dev/null"]
cmd = (
["hipcc"]
+ flag_hip.split()

Copilot AI Dec 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using split() without arguments will split on all whitespace characters. If a compiler flag legitimately contains multiple consecutive spaces or other whitespace characters, this could cause unexpected behavior. Consider using a more robust parsing approach if flags might contain quoted strings or special whitespace handling. Verify that all flags passed to this function are compatible with simple whitespace splitting.

Copilot uses AI. Check for mistakes.
+ ["-x", "hip", "-E", "-P", "/dev/null", "-o", "/dev/null"]
)
try:
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
subprocess.check_output(cmd, stderr=subprocess.DEVNULL)
except subprocess.CalledProcessError:

Copilot AI Dec 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exception variable 'e' is captured but not used in the exception handler. Consider either using it (e.g., logging the error details) or removing the variable name to make it explicit that it's intentionally unused.

Copilot uses AI. Check for mistakes.
logger.warning(f"Current hipcc not support: {flag_hip}")
logger.warning(f"Current hipcc not support: {flag_hip}, skip it.")
return False
return True

Expand Down
Loading