chore(runtime): bump simpler to 4d5fbe4c; adapt STRACE span rename (supersedes #1907)#1933
chore(runtime): bump simpler to 4d5fbe4c; adapt STRACE span rename (supersedes #1907)#1933luohuan19 wants to merge 3 commits into
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR updates benchmark span parsing in bench.py to derive host/device span names dynamically from strace_timing._ROUNDS_TABLE_NAMES (replacing hardcoded ChangesRuntime span rename and build compatibility
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces compatibility support for multiple generations of the simpler runtime by dynamically sourcing span names and detecting the presence of the arg_index parameter in CoreCallable.build. The review feedback suggests robust error handling for cases where older runtime versions lack the expected metadata, and a fallback mechanism for when Python is run with optimized settings that strip docstrings, which would break the current feature detection.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…w-native-sys#1181 simpler hw-native-sys#1181 ("replace arg_index with positional dump + func_id array") removed the ``arg_index`` parameter from ``CoreCallable.build`` — the binding is now ``build(signature, binary)``. pypto passes ``arg_index=`` and therefore raises ``TypeError`` against hw-native-sys#1181+ runtimes, while pre-hw-native-sys#1181 runtimes still *require* ``arg_index`` parallel to ``signature``, so it cannot be unconditionally dropped. Feature-detect ``arg_index`` support once from the nanobind signature (``CoreCallable.build.__doc__``) and pass it only when accepted, via a new ``_build_core_callable`` helper shared by both kernel-compile paths in ``compile_and_assemble``. pypto then drives both the pinned (pre-hw-native-sys#1181) and the latest (hw-native-sys#1181+) simpler runtime without a pin bump.
Bumps the runtime submodule 02bd0c4f -> 4d5fbe4c (simpler main). The only pypto-facing change across that range is simpler hw-native-sys#1210, which renamed the [STRACE] span-tree root run_prepared -> simpler_run (in the device emitters and strace_timing._ROUNDS_TABLE_NAMES; the host/device keys are unchanged). bench.py hardcoded the old span names in _parse_stats_from_strace, so on a hw-native-sys#1210+ runtime by_name().get(...) returned None and every host/device wall sample was silently 0.0. Derive the names from the installed runtime's _ROUNDS_TABLE_NAMES instead of hardcoding, so benchmark() works against both runtime generations (matching the arg_index feature-detect approach). test_benchmark.py: the parse tests built synthetic markers with a hardcoded run_prepared root; the fixture now returns _ROUNDS_TABLE_NAMES["host"] and the markers build their names off it, keeping the tests generation-agnostic. The rest of pypto's consumed surface is unchanged across the bump: public Worker API (hw-native-sys#1210 renamed only internal ChipWorker/binding methods), CoreCallable.build's dropped arg_index (hw-native-sys#1181, feature-detected in the prior commit), and the Tensor struct / orchestration API headers.
…s#1181+ The runtime submodule now pins to a post-hw-native-sys#1181 simpler (bumped in the prior commit), where CoreCallable.build's arg_index parameter is gone. Since pypto's runtime is the submodule via editable install, pin and runtime are always the same generation, so the pre-hw-native-sys#1181 branch of the feature-detect was dead the moment the pin crossed hw-native-sys#1181. Remove the compat shim: - device_runner: drop the __doc__-sniffing _BUILD_ACCEPTS_ARG_INDEX and the _build_core_callable helper; call CoreCallable.build(signature, binary) directly at both kernel-compile sites. - pto_backend: stop baking "arg_index" into the generated kernel_config.py — nothing reads it post-hw-native-sys#1181 (runtime switched to a positional dump + func_id array), so it was write-only dead data with a now-false comment. The unrelated dump-tag "arg_index" JSON field (runtime tensor-dump schema) is untouched.
5391dc1 to
bcae731
Compare
Problem
Bumping the
runtimesubmodule to current simplermain(4d5fbe4c) requires two pypto adaptations, one of which fails silently:arg_indexfromCoreCallable.build(build(signature, binary)), while pre-[Bug] pl.cast(index -> UINT) drops type annotation in pto.tci, PTOAS fails with 'expected :' #1181 runtimes still require it. pypto passesarg_index=unconditionally →TypeErroron [Bug] pl.cast(index -> UINT) drops type annotation in pto.tci, PTOAS fails with 'expected :' #1181+ runtimes.[STRACE]span-tree rootrun_prepared→simpler_run(device emitters +strace_timing._ROUNDS_TABLE_NAMES). pypto'sbench.pyhardcoded the old names in_parse_stats_from_strace, so on a refactor(codegen): Lower tile.slice/assemble to pto.subview #1210+ runtimeby_name().get(...)returnsNoneand every host/device wall sample is silently0.0(no error).Fix
arg_index(device_runner.py) — feature-detect support once fromCoreCallable.build.__doc__and passarg_indexonly when accepted, via a shared_build_core_callablehelper. Drives both runtime generations with no branch on the pin. (This commit is @noabauma's from fix(runtime): makeCoreCallable.buildarg_indexoptional for simpler #1181 #1907, cherry-picked to keep the two adaptations together in one coherent bump; this PR supersedes fix(runtime): makeCoreCallable.buildarg_indexoptional for simpler #1181 #1907.)_SPAN_HOST/_SPAN_DEVICE; derive the keys from the installed runtime's_ROUNDS_TABLE_NAMESinside_parse_stats_from_strace. Works against bothrun_prepared(pre-refactor(codegen): Lower tile.slice/assemble to pto.subview #1210) andsimpler_run(refactor(codegen): Lower tile.slice/assemble to pto.subview #1210+) runtimes.02bd0c4f→4d5fbe4c.Adaptation audit (02bd0c4f → 4d5fbe4c)
The rest of pypto's consumed surface is unchanged:
WorkerAPI — refactor(codegen): Lower tile.slice/assemble to pto.subview #1210 renamed only internal_ChipWorker/binding methods (prepare_callable→register_callable), notWorker.register/run/....Tensorstruct + orchestration API headers — comment-only diff;host_api.hadditions are internal.simpler_setuptools consumed by pypto (torch_interop,strace_timing,swimlane_converter,log_config,KernelCompiler) — signatures intact.Testing
tests/ut/runtime/test_benchmark.py— 17 passed against the4d5fbe4cruntime (parse tests exercise the realstrace_timing, resolving tosimpler_run). The fixture now sources the span root from_ROUNDS_TABLE_NAMES, keeping the tests generation-agnostic.ruffclean.test_benchmark_st.py(assertsdevice_wall_us > 0) is the on-device regression guard for the span rename — not yet run on-device here.Notes
No public API change. Distributed L3/L2 and SPMD paths are not device-validated post-#1210 (larger separate surface).