refactor(runtime): move orch_device_id into aicpu_device_config, out of platform_regs#1228
Conversation
…of platform_regs
orch_device_id is the ACL device ordinal latched once per device by
simpler_aicpu_init (from InitArgs.device_id) and read by the AICPU executor to
make the staged orchestration SO filename unique per device. It is a per-device
run-invariant knob — the same category as scheduler_timeout — and has nothing to
do with per-core register addressing, so platform_regs was the wrong home.
Now that aicpu_device_config exists as the dedicated home for per-device AICPU
config latched by simpler_aicpu_init, move set/get_orch_device_id + the global
there, alongside set/get_scheduler_timeout_ms. platform_regs is left strictly for
per-core register access.
- aicpu_device_config.{h,cpp}: add set/get_orch_device_id + g_orch_device_id.
- platform_regs.{h,cpp} (a5 + a2a3): remove them.
- aicpu_executor.cpp (a5 + a2a3): include aicpu_device_config.h for the
get_orch_device_id consumer (still needs platform_regs.h for get_platform_regs).
- kernel.cpp / sim device_runner: unchanged — the symbol name is identical, only
its defining TU moved (same AICPU SO; sim dlsym still resolves it).
No behavior change. Verified: all four quadrants build; runtime_fatal_codes
scheduler_timeout (which exercises the register->orch-SO path) passes on
a5sim + a2a3sim.
Stacked on hw-native-sys#1223 (which introduces aicpu_device_config).
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
💤 Files with no reviewable changes (4)
📝 WalkthroughWalkthroughThis PR relocates the orchestration device ordinal API ( ChangesOrchestration Device ID Relocation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
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 |
What
Follow-up cleanup to #1223.
orch_device_id(the ACL device ordinal) is latched once per device bysimpler_aicpu_init(fromInitArgs.device_id) and read by the AICPU executor (create_orch_so_file(..., get_orch_device_id(), ...)) to make the staged orchestration-SO filename unique per device.It is a per-device, run-invariant knob — the exact same category as
scheduler_timeout(moved in #1223) — and has nothing to do with per-core register addressing. It lived inplatform_regsonly for historical reasons. #1223 introducedaicpu_device_configas the dedicated home for per-device AICPU config latched bysimpler_aicpu_init; this finishes the job by movingorch_device_idthere too, soplatform_regsis left strictly for per-core register access.How
aicpu_device_config.{h,cpp}: addset/get_orch_device_id+ theg_orch_device_idglobal, alongsideset/get_scheduler_timeout_ms.platform_regs.{h,cpp}(a5 + a2a3): remove them.aicpu_executor.cpp(a5 + a2a3): includeaicpu/aicpu_device_config.hfor theget_orch_device_idconsumer (keepsplatform_regs.h— still usesget_platform_regs).kernel.cpp(latch) and simdevice_runner(dlsymset_orch_device_id): unchanged — the symbol name is identical, only its defining TU moved (same AICPU SO; sim dlsym still resolves it).No behavior change.
platform_regsnow holds only register-addressing state.Test
runtime_fatal_codes::scheduler_timeout— which exercises theregister_callable→load_orch_so→create_orch_so_file(get_orch_device_id())consumer path — passes on a5sim + a2a3sim.Onboard hardware runs still recommended before merge.
🤖 Generated with Claude Code