onnxruntime
368634ee - fix(ci): use subprocess for Triton compile helpers (#28775)

Commit
34 days ago
fix(ci): use subprocess for Triton compile helpers (#28775) ## Summary This PR replaces shell-based command execution in the Triton compile helper with `subprocess.run()`, and adds regression tests to lock in that behavior. ## Key Changes - Switched `tools/ci_build/compile_triton.py` to use `subprocess.run()` for `objcopy` and `ar` execution instead of `os.system()`. - Added `tools/ci_build/test_compile_triton.py` to verify the helper functions invoke subprocess-based command execution and preserve the expected working directory and error handling. - Hardened directory handling in the Triton compile path so the output directory is created safely with `os.makedirs(..., exist_ok=True)`. ## Why The previous shell-based implementation was fragile and harder to test. Using `subprocess.run()` makes the command execution path explicit, easier to validate, and safer for CI and cross-platform invocation. ## Testing - `source .venv/bin/activate && python -m unittest tools.ci_build.test_compile_triton` - `source .venv/bin/activate && lintrunner -a` --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Author
Parents
Loading