Conversation
…cyclic import Move kernel_shape_tool_dir and resolve_sglang_shape_mode out of the module-level _server_patcher import and into materialize_config_with_envs, clearing the CodeQL module-level cyclic-import alerts on those lines. Matches the function-local pattern in _multi_node_server_lifecycle. Co-authored-by: Cursor <cursoragent@cursor.com>
0f0e97c to
b6d9de2
Compare
devalshahamd
left a comment
There was a problem hiding this comment.
One minor comment added.
We can also reduce the added comments at certain places to reduce code size, especially when the added comments refer to what used to be there.
Otherwise LGTM.
| # ``_workload_envs`` (matches ``_multi_node_server_lifecycle``). | ||
| from ._server_patcher import kernel_shape_tool_dir, resolve_sglang_shape_mode | ||
|
|
||
| is_sglang = not is_atom and "vllm" not in fw |
There was a problem hiding this comment.
Should we rely on this- if it is not vLLM or ATOM, must be SGLang?
|
Hi @mohbasit @devalshahamd Could you share a SHA you used for E2E with kernel-shape events in the trace? |
|
@BaoYunkai This is the SHA with which we have tested the code. It will be in the upcoming tracelens release. commit d5fdb7de85d84d12f443c2a3178336cbe09205d5 (HEAD -> kernel-shape-profiler-registry, origin/kernel-shape-profiler-registry) |
|
Hi @BaoYunkai , did you try out this SHA? |
5ba6a6e to
66b7b0d
Compare
|
Hi @mohbasit, TraceLens Before merge, could you please:
Thanks! |
|
@BaoYunkai I have added the latest commit in the TRACELENS_REF and solved conflict. After an E2E run, we should be good to merge |
|
Run 1 (roofline off): patchless shape tool ran during profile (kernel_shape_profiler enabled…disabled in server.log, no source patch), but trace was never analyzed. @BaoYunkai We are good to merge, i have attached my test result |
Description: what and why Switches SGLang shape discovery to the no-patch mechanism for SGLang ≥ 0.5.18. Instead of git apply-ing the TraceLens sglang_roofline_patches into the installed SGLang source, the profile path now puts the no-patch kernel_shape_tool on the server
PYTHONPATHand setsTRACELENS_SHAPE_DISCOVERY=1, so CPython auto-loads the tool's sitecustomize.py to add Input Dims/Input type/Input Strides to profiler traces. The version gate (resolve_sglang_shape_mode()in_server_patcher.py) selects sitecustomize for ≥ 0.5.18 and legacy patched otherwise. Wiring is mirrored in the single-node (_workload_envs.py, _multi_node_server_lifecycle.py) and pod-side multi-node launchers (launch_multinode.py, launch_infera_node.py, infera.py). Also breaks the CodeQL module-level cyclic import by making the shape-mode imports function-local, and applies ruff format.Linked issue(s): close/fix refs None.
Tests: added/updated? commands run? No new unit tests. Validated end-to-end on a single-GPU Qwen3-8B SGLang 0.5.18 run: the profile step produced a trace with sglang_profiler:: kernel-shape ops (patchless path active).
Breaking changes: yes/no No. SGLang < 0.5.18 continues to use the existing patched path; only ≥ 0.5.18 switches to the no-patch mechanism.
PR addresses single concern: yes/no Yes — moving SGLang shape discovery off source patching (the cyclic-import and ruff-format fixes are incidental cleanups required to make the same change pass CI).
Root cause is upstream (Magpie/TraceLens/GEAK/IntelliKit/AgentKernelArena), ticket filed: N/A — this is a Hyperloom-side change. It depends on the TraceLens kernel_shape_tool (no-patch) being present under TRACELENS_ROOT.