feat(ci): add mirage/rocjitsu emulation tests#6436
Draft
amd-arosa wants to merge 5 commits into
Draft
Conversation
Add a reusable helper plus two GPU-less tests that run through the mirage CLI on top of the rocjitsu emulator, so they can run on `rocjitsu-cpu` runners: - emulation_utils.py: locate the mirage binary, map an AMDGPU family to a builtin mirage profile, and wrap a native command as `mirage run`. - test_rocrtst_emulation.py: run the rocrtst64 suite under rocjitsu. Defaults to the reduced (non-full) set and is configurable via EMULATION_TEST_TYPE; skips cleanly for families rocjitsu cannot emulate. - test_mirage_smoke.py: minimal mirage CLI smoke test using the noop backend.
Add rocrtst-emulation and mirage-smoke to the test matrix and select their runner node purely from the emulator backend, so adding a new backend/node is a one-line change and never needs a workflow edit. - fetch_test_configurations.py: add _EMULATOR_RUNNERS (rocjitsu -> rocjitsu-cpu, rocjitsu-dbt -> rocjitsu-gpu, noop -> rocjitsu-cpu), set `emulation_runner` per job, and drop GPU container options only for GPU-less emulation nodes. - test_artifacts.yml: route jobs to the resolved `emulation_runner`.
❌ PR Check — Action Required
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🚫 Please fix the failed policies before requesting reviews. The following policy checks failed:
The |
Emulation jobs now derive their mirage CLI (and any backend runtime) artifacts from the emulator backend instead of listing them in each matrix entry. _EMULATOR_RUNNERS gains a `fetch_args` field (rocjitsu/rocjitsu-dbt -> --mirage --rocjitsu, noop -> --mirage) that is merged, de-duplicated, into each emulation job's fetch_artifact_args. Matrix entries now list only their own component artifacts (rocrtst-emulation: --rocrtst --tests; mirage-smoke: none), and adding a backend stays a one-line change.
The noop backend is not compiled into the CI mirage build (mirage emulators
lists only rocjitsu / rocjitsu-dbt), so the noop-based smoke test always failed.
Remove noop entirely and make mirage-smoke run rocminfo on top of the rocjitsu
emulator, asserting the emulated GPU is visible ("Device Type: GPU"). The
runner has no physical GPU, so a GPU agent can only come from rocjitsu. Its
emulator now autofills --mirage --rocjitsu (rocminfo ships in the base
artifacts).
rocrtstFunc.IPC (cross-process IPC memory handles) and rocrtstFunc.Deallocation_Notifier_Test (deallocation notifier callbacks) are not implemented by rocjitsu and fail the rocrtst-emulation job. Exclude both on every family, for both the quick and full sets, via EMULATION_UNSUPPORTED_TESTS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
rocrtst and most of our other runtime tests need a real GPU to run, which ties
them to our (limited) pool of GPU runners. rocjitsu is a CPU-based GPU emulator —
it executes AMD GPU code objects on the host — and mirage is the CLI that drives
it. Running tests through mirage means we can exercise the runtime on plain CPU
machines, and eventually on architectures we don't have silicon for yet.
This is the first emulation test wired into the matrix. The other goal was to set
it up so adding the next one doesn't require rethinking any of the CI plumbing.
Technical Details
The main idea is that an emulation job picks its runner from the emulator it uses,
not from a hardcoded label. A matrix entry opts in by setting
"emulator", andfetch_test_configurations.pymaps that to a node (and whether the node has aGPU) in
_EMULATOR_RUNNERS:rocjitsu→rocjitsu-cpu, no GPUrocjitsu-dbt→rocjitsu-gpu, has a GPU (dbt offloads to hardware)noop→rocjitsu-cpu, no GPUThe script writes the resolved label to
emulation_runner, and the GPU containerdevices (
/dev/kfd, the video groups, etc.) are only added when the nodeactually has a GPU. An unknown emulator raises instead of quietly falling through
to a GPU runner. The workflow just reads
emulation_runner— same pattern asmulti_gpu_runner— so adding a new backend or node is a one-line change in themap and no workflow edits.
The rest:
emulation_utils.py— small helper to find the mirage binary, pick the mirageprofile for an AMDGPU family, and build the
mirage run ... -- <cmd>command.test_rocrtst_emulation.py— runsrocrtst64under rocjitsu. Emulation isslow, so it runs the reduced test set by default; set
EMULATION_TEST_TYPE=fullfor the whole suite. Families rocjitsu can't emulate are skipped.
test_mirage_smoke.py— a minimal check that mirage works, using thenoopbackend (no GPU, no rocjitsu runtime needed).
Linux only, since the emulation artifacts are Linux only.
The triggering side lives in a separate rocm-systems PR (emulation changes run the
smoke test; runtimes/all/nightly run rocrtst-emulation), so this PR stands on its
own. Note that the
rocjitsu-cpurunner label needs to exist for the jobs toland somewhere.
Test Plan
mirage and rocjitsu run for real in CI, so locally I checked the matrix output and
the script logic:
rocrtst-emulation,mirage-smoke, and arocjitsu-dbtentry.test_mirage_smoke.pyagainst a stub mirage.test_rocrtst_emulation.pyfor supported/unsupported families and forquick vs full.
In CI, the plan is to dispatch the multi-arch workflow with
linux_test_labels: test:mirage-smoke(thentest:rocrtst-emulation) on asupported family — gfx942, gfx950, or gfx1250.
Test Result
Everything above passes locally:
rocjitsu-cpuwith no GPU devices; rocjitsu-dbtroutes to
rocjitsu-gpuand keeps them; non-emulation jobs are unchanged; a bademulator name raises.
by default, runs the full set with
EMULATION_TEST_TYPE=full, shards correctly,and skips gfx1151.
Submission Checklist