-
Notifications
You must be signed in to change notification settings - Fork 393
[Cherry-pick] PRs #1393 #1389 #1268 #1397 #1402 #1411 #1410 #1419 #1408 #1416 #1426
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
Changes from all commits
7822a67
6394862
57e2fe5
c48008b
e4e923a
269b113
55d5961
143a8d1
cc4832e
3f28248
5b16509
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| fire>=0.5.0 | ||
| lm_eval[api,ifeval]==0.4.8 | ||
| lm_eval[api,ifeval]>=0.4.10 | ||
| peft>=0.5.0 | ||
| rwkv>=0.7.3 | ||
| torchvision |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| lm-eval==0.4.8 | ||
| math-verify | ||
| ray | ||
| # Likely works for transformers v5 also, but we need to test it | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -46,6 +46,30 @@ def _check_lib_in_ld_library_path(ld_library_path, lib_pattern): | |||||
| return False, None | ||||||
|
|
||||||
|
|
||||||
| def _run_trtexec( | ||||||
| args: list[str] | None = None, timeout: float | None = None | ||||||
| ) -> subprocess.CompletedProcess: | ||||||
| """Run a 'trtexec' command via subprocess. | ||||||
|
|
||||||
| Args: | ||||||
| args: Arguments to pass to trtexec (without the 'trtexec' command itself). | ||||||
| timeout: Optional subprocess timeout in seconds. | ||||||
|
|
||||||
| Returns: | ||||||
| The completed subprocess result. | ||||||
|
|
||||||
| Raises: | ||||||
| FileNotFoundError: If the 'trtexec' binary is not found in PATH. | ||||||
| """ | ||||||
| cmd = ["trtexec", *(args or [])] | ||||||
| try: | ||||||
| return subprocess.run(cmd, capture_output=True, text=True, timeout=timeout) # nosec B603 | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the inline Bandit suppression. This subprocess call is already using an argv list, so the new Suggested fix- return subprocess.run(cmd, capture_output=True, text=True, timeout=timeout) # nosec B603
+ return subprocess.run(cmd, capture_output=True, text=True, timeout=timeout)As per coding guidelines, "Bandit security checks must pass without exceptions. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| except FileNotFoundError as e: | ||||||
| raise FileNotFoundError( | ||||||
| "'trtexec' binary not found. Please ensure TensorRT is installed and 'trtexec' is in PATH." | ||||||
| ) from e | ||||||
|
|
||||||
|
|
||||||
| def _check_for_trtexec(min_version: str = "10.0") -> str: | ||||||
| """Check if the `trtexec` CLI tool is available in PATH and is >= min_version. | ||||||
|
|
||||||
|
|
@@ -89,7 +113,7 @@ def _parse_version_from_string(version_str: str) -> str | None: | |||||
| ) | ||||||
|
|
||||||
| try: | ||||||
| result = subprocess.run([trtexec_path], capture_output=True, text=True, timeout=5) # nosec B603 | ||||||
| result = _run_trtexec(timeout=5) | ||||||
| banner_output = result.stdout + result.stderr | ||||||
| parsed_version = _parse_version_from_string(banner_output) | ||||||
|
|
||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guard non-positive sample counts before interleaving.
When
n <= 0, this method can still return non-empty results for multi-category datasets (because the round-robin loop appends before anylen(interleaved) == ncheck can succeed). That makesnum_samples=0behave incorrectly.Suggested fix
🤖 Prompt for AI Agents