Skip to content

[CI][ROCm] Export kernel source maps for CI selection - #59100

Merged
khluu merged 11 commits into
mainfrom
akaratza_rocm_ci_selector
Oct 24, 2026
Merged

khluu merged 11 commits into
mainfrom
akaratza_rocm_ci_selector

Conversation

@AndreasKaratzas

@AndreasKaratzas AndreasKaratzas commented Sep 28, 2026 •

Copy link
Copy Markdown
Member
  • Add a ROCm kernel-to-source map producer that reads the actual CMake/Ninja objects, including host uses, header dependencies, and embedded GPU architectures.
  • Record HIPify provenance for generated sources and copied or renamed headers while leaving the original sources intact.
  • Preserve the original vendor header and repository patch as dependencies of generated Torch headers.
  • Generate maps in an opt-in stage after native compilation and expose a separate Docker export target.
  • Export and upload the map with its build commit after a successful build or image reuse, clearing stale exports; optional map failures leave the image job successful.
  • Forward recorder output and job identity from single-node AMD Docker jobs to the agent's artifact directory.
  • Run producer, provenance, export, and runner regressions through the existing CMake and Docker metadata test jobs.

NVIDIA image builds already export kernel source maps for the CI selector. ROCm needs the same ownership information, but its native build transforms CUDA sources and headers into HIP inputs. The map uses the retained compilation and dependency records to recover those original paths and refuses incomplete or unsupported builds. This supplies the source half of the companion native SDK recording path, allowing CI to join observed kernel names to repository changes without guessing ownership.

Companion: ci-infra native recording and selection for both backends. Its consumers should be deployed before enabling the new map and recorder producers.

AI assistance was used to implement these changes and run the validation.

Preserve HIPify and header provenance in native build maps, export the matching ROCm artifact, and forward single-node AMD recorder output.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Andreas Karatzas <andreas.karatzas@protonmail.com>
AndreasKaratzas and others added 2 commits September 28, 2026 23:22
Export the ROCm kernel map separately after required build outputs succeed,
and attempt a map-only export when the image already exists. Preserve strict
image, wheel, smoke, and explicit map failures while treating optional map
preparation, export, and upload failures as unavailable evidence.

Reuse native content caches and add process regressions for fresh and cached
builds, stale output, failure propagation, and disabled/print-only recording.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Andreas Karatzas <andreas.karatzas@protonmail.com>
Collect dependencies from each compiled GPU target and union them with host dependencies before provenance and freshness checks. Validate object targets, expand compiler response files, and preserve build outputs during dependency extraction.

Forward vLLM worker method and shutdown timeout through the AMD runner. Add real HIP build regressions for device-only headers and compiler argument handling.

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Andreas Karatzas <andreas.karatzas@protonmail.com>
@AndreasKaratzas

Copy link
Copy Markdown
Member Author

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@AndreasKaratzas

Copy link
Copy Markdown
Member Author

/ci rerun

@vllm-agent

Copy link
Copy Markdown
Collaborator

CI selector (shadow): no narrower answer, every step runs: 193 test steps (269 jobs) instead of 193 (269 jobs)

Shadow mode: this changes nothing about what CI runs. It shows what the evidence-based selector would pick for this PR, next to today's rules. How it works.

Feedback welcome: reply here if it would skip a step this change needs, or runs something unrelated.

steps (jobs) Today's rules Selector Would skip Would add
NVIDIA, CPU and others 193 (269) 193 (269) 0 (0) 0 (0)
AMD mirrors 163 (227) 163 (227) 0 (0) 0 (0)

Why: fail-open: CMakeLists.txt is a docker-image build input (docker/Dockerfile COPY); the CI image is rebuilt from it; running everything

Today's rules run everything for this diff.

Selector would run (193)
  • amd-fp8-moe-kernels-mi355
  • amd-kernels-mi355
  • amd-lm-eval-small-models-harness
  • amd-native-quantization-kernels-mi355
  • amd-qwen3-next-mtp-async-eplb-accuracy
  • arm-cpu-test ×3
  • ascend-npu-test
  • async-engine-inputs-utils-worker
  • basic-correctness ×2
  • basic-correctness-cpu-offload
  • basic-correctness-cumem
  • basic-correctness-prefetch-offload
  • basic-correctness-sleep-mode
  • basic-models-test-other-cpu
  • basic-models-tests-extra-initialization ×14
  • basic-models-tests-initialization
  • basic-models-tests-other
  • batch-invariance-b200
  • batch-invariance-h100
  • benchmarks-cli-test
  • cpu-distributed-tests-dp-tp
  • cpu-distributed-tests-pp-tp
  • cpu-kernel-tests ×2
  • cpu-language-generation-and-pooling-model-tests ×3
  • cpu-multi-modal-model-tests-n ×4
  • cpu-multimodal-config
  • cpu-params-env-tokenizers-parser
  • cpu-quantization-model-tests
  • cpu-qwen2-5-vl-multimodal-tests
  • cpu-reasoning-renderers
  • cpu-spec-decode-tests
  • cpu-tool-parsers
  • crcr-report
  • crosslayer-kv-layout-distributed-nixlconnector-pd-accuracy-tests-4-gpus
  • cudagraph
  • deepseek-v4-kernel-test-b200
  • deepseek-v4-kernel-test-h100
  • distributed-comm-ops
  • distributed-compile-comm-4-gpus
  • distributed-compile-rpc-tests-2-gpus
  • distributed-compile-unit-tests-2xh100
  • distributed-dp-tests-2-gpus
  • distributed-dp-tests-4-gpus
  • distributed-flashinfer-nixlconnector-pd-accuracy-4-gpus
  • distributed-model-tests-2-gpus ×3
  • distributed-mooncakeconnector-pd-accuracy-4-gpus
  • distributed-nixlconnector-pd-accuracy-4-gpus
  • distributed-tests-8xh100
  • distributed-torchrun-examples-4-gpus
  • distributed-torchrun-shutdown-tests-2-gpus
  • docker-build-metadata
  • dp-ep-distributed-nixlconnector-pd-accuracy-tests-4-gpus
  • e2e-core-1-gpu
  • e2e-core-large-memory
  • e2e-scheduling-1-gpu
  • e2e-scheduling-accuracy-1-gpu
  • elastic-ep-scaling-test
  • engine
  • engine-1-gpu
  • entrypoints-integration-api-server ×4
  • entrypoints-integration-api-server-generate
  • entrypoints-integration-api-server-openai-chat_completion
  • entrypoints-integration-api-server-openai-completion
  • entrypoints-integration-llm
  • entrypoints-integration-multimodal
  • entrypoints-integration-pooling
  • entrypoints-integration-responses-api
  • entrypoints-integration-speech_to_text
  • entrypoints-unit-tests
  • eplb-algorithm
  • eplb-execution
  • examples
  • extract-hidden-states-integration
  • extract-hidden-states-integration-2-gpus
  • fault-tolerance-e2e-2xh100
  • fusion-and-compile-unit-tests-2xb200
  • fusion-e2e-config-sweep-h100
  • fusion-e2e-quick-h100
  • fusion-e2e-tp2-ar-rms-config-sweep-h100
  • fusion-e2e-tp2-ar-rms-dynamo-partition-amd
  • fusion-e2e-tp2-ar-rms-inductor-partition-amd
  • fusion-e2e-tp2-asynctp-config-sweep-h100
  • fusion-e2e-tp2-b200
  • fusion-e2e-tp2-quick-h100
  • gemm-rs-ar-2xb200
  • glm5next-unit-tests
  • hybrid-ssm-nixlconnector-pd-accuracy-tests-4-gpus
  • hybrid-ssm-nixlconnector-pd-prefix-cache-2-gpus
  • inkling-unit-tests-b200
  • intel-hpu-test
  • jit-monitor-no-runtime-jit
  • kernels-attention-diffkv-test-h100
  • kernels-attention-test ×7
  • kernels-b200 ×3
  • kernels-core-operation-test ×3
  • kernels-deepgemm-test-h100
  • kernels-fla-ops-test-b200
  • kernels-flashmla-test-h100
  • kernels-fusedmoe-layer-test-2-b200s
  • kernels-fusedmoe-layer-test-2-h100s
  • kernels-helion-test ×5
  • kernels-mamba-test
  • kernels-mhc-test-b200
  • kernels-minimax-reduce-rms-test-2-gpus
  • kernels-moe-test ×5
  • kernels-quantization-test ×6
  • kernels-root-misc-test-b200
  • kimi-k3-prefix-cache-4xb200 ×2
  • kimi-k3-unit-tests-b200
  • kv-offload-large
  • kv-offload-medium
  • kv-offload-small
  • language-models-tests-extra-standard ×2
  • language-models-tests-granite-l4-compatibility
  • language-models-tests-hybrid ×2
  • language-models-tests-standard
  • lm-eval-dspark-watermark-2xh100
  • lm-eval-small-models
  • lm-eval-turboquant-k3v4nc
  • lm-eval-turboquant-k8v4
  • lm-eval-turboquant-t3nc
  • lm-eval-turboquant-t4nc
  • lm-eval-watermarking
  • lora ×4
  • lora-tp-distributed ×4
  • metrics-tracing-2-gpus
  • model-executor
  • mooncake-ec-tcp-e2e-2-gpus
  • mrcr-eval-small-models
  • multi-modal-accuracy-eval-small-models
  • multi-modal-models-standard-1-qwen2
  • multi-modal-models-standard-2-qwen3-gemma
  • multi-modal-models-standard-3-llava-qwen2-vl
  • multi-modal-models-standard-4-other-whisper
  • multi-modal-processor ×4
  • multi-modal-processor-cpu ×4
  • multiconnector-nixl-offloading-pd-accuracy-2-gpus
  • multiconnector-nixl-offloading-pd-edge-cases-2-gpus
  • nixlconnector-pd-edge-cases-2-gpus
  • openai-api-correctness
  • pipeline-context-parallelism-4-gpus
  • platform-tests
  • plugin-tests-2-gpus
  • push-nixlconnector-pp-prefill-pd-accuracy-4-gpus
  • pytorch-compilation-dynamic-shapes
  • pytorch-compilation-passes-unit-tests
  • pytorch-compilation-unit-tests
  • pytorch-compilation-unit-tests-h100
  • pytorch-fullgraph-cudagraph-l4-compatibility
  • pytorch-fullgraph-test
  • pytorch-nightly-dependency-override-check
  • quantization ×4
  • quantized-fusions
  • quantized-models-test
  • quantized-moe-test-b200
  • qwen4-exp-unit-tests
  • qwen4-exp-unit-tests-cpu
  • ray-dependency-compatibility-check
  • rayexecutorv2-4-gpus
  • regression
  • replayssm-e2e
  • rust-frontend-cargo-style-clippy
  • rust-frontend-cargo-tests
  • rust-frontend-core-correctness
  • rust-frontend-distributed
  • rust-frontend-openai-coverage
  • rust-frontend-serve-admin-coverage
  • rust-frontend-tool-use
  • samplers-multimodal-beam-search
  • samplers-test
  • scale-out-ec-e2e-2-gpus
  • sharded-rdt-weight-transfer
  • spec-decode-draft-model ×4
  • spec-decode-eagle-1-deepseek-qwen
  • spec-decode-eagle-2-llama3-qwen-vl-other
  • spec-decode-mtp-deepseek-mimo
  • spec-decode-mtp-gemma4
  • spec-decode-mtp-qwen3-5
  • spec-decode-ngram-suffix
  • spec-decode-speculators
  • torch-stable-abi-audit
  • v1-attention-b200 ×2
  • v1-attention-h100-mi300 ×2
  • v1-core
  • v1-executor-worker
  • v1-kv-connectors ×4
  • v1-kv-offload
  • v1-logits-oracle
  • v1-metrics-lmeval
  • v1-others-cpu
  • v1-sample
  • v1-spec-decode
  • vllm-ir-tests
Would skip (today's rules run them) (0)

none

Would add (today's rules do not run them) (0)

none

AMD mirrors: would skip (0)

none

AMD mirrors: would add (0)

none

14 changed files · base 84bcbc6264 · head 756d56826d · Python record: build 92744 at 1a001d5842 · kernel record: table 1a001d5 (build 92744), map 1a001d5 · not counted: 10 build steps, 5 A100 steps the generator no longer emits, 138 optional steps the selector would also run

@AndreasKaratzas

Copy link
Copy Markdown
Member Author

Another run complete: https://buildkite.com/vllm/amd-ci/builds/14676/list

@AndreasKaratzas

Copy link
Copy Markdown
Member Author

When run-amd-test.sh finds no checkout to mount, the container still
sourced ci_setup.sh and recorded into a directory that --rm discards.
Pass KERNREC_DISABLE=1 so the job runs unrecorded and says why
(ci-infra#685 honors it). Also trigger the hipify provenance test on
changes to cmake/hipify.py.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
@AndreasKaratzas

Copy link
Copy Markdown
Member Author

Status of the AMD failures in https://buildkite.com/vllm/ci/builds/95743 (ROCm 7.2 image). The branch is based on main from 2026-10-03 (84bcbc6264), 870 commits behind, so three of the five are already fixed there.

Job Failing test Status Evidence
MI355 Distributed DP Extended test_async_llm_dp.py::test_dp_pause_wait_mode_drains_in_flight (30 s timeout) Fixed on main by #60572 (7816afdb25) The test paused before its request was scheduled, so the drain had nothing to wait for. main build 95734 passes it (shards 1/2 and 2/2).
MI355 DPX Basic Models (Extra Initialization) shard 1 test_can_initialize_large_subset[UnlimitedOCRForCausalLM] Fixed on main by #61590 (bb1438a93f) Upstream model_type rename of baidu/Unlimited-OCR now requires trust_remote_code.
MI355 DPX Multimodal Processor shard 4 test_model_tensor_schema[baidu/Unlimited-OCR] Fixed on main by #61590 (bb1438a93f) Same root cause as above.
MI355 DPX V1 KV Offload test_async_lookup.py::test_found_key_returns_true (assert None is True) Flaky test race, also on main The test helper signals before the worker posts the result. main daily 95734 failed identically. Fix: #62373.
MI250 V1 Engine none failed (203 passed, 4 skipped); pytest segfaulted at exit (exit 139) Recorder-related, under investigation Only kernrec-armed run of this job and the only exit-time crash in 294 AMD jobs. kernrec's own footer for that process completed (tool_fini ran), so the crash is later in SDK/HIP teardown. Leading candidate: ROCm/rocm-systems#13668 (rocprofiler-sdk keeps a stale fat-binary pointer after HIP unregisters it; fixed upstream on 2026-10-16, not in the SDK pinned by the 7.2 image).

Recorder fixes from this investigation, pushed to ci-infra#685 (be3c882e) with the vLLM side in 0bfe467c2c here; validated by rerunning this job's command under the recorder on ROCm 10 (218 passed, the collector now scores the job complete):

  • Fork children are marked incomplete only if they load GPU code. In this job 32 of 69 recordings were false fork_after_sdk_init markers from py-cpuinfo and Ray startup, which made the job's coverage unusable.
  • GPU-idle processes killed without a footer (Ray daemons, 4 here) no longer make a job incomplete; a process cannot dispatch without first loading code, and the recorder now records that point.
  • ROCProfiler SDK 1.3.5 (ROCm 10, now the default image) is accepted alongside 1.3.2; without it, recording disarms after merging main.
  • The job sidecar lists its recordings, so a partial artifact download no longer folds as complete.

AndreasKaratzas and others added 2 commits October 19, 2026 02:25
main requires Python 3.11, so ruff (UP017) rewrites
datetime.timezone.utc on the PR's merge ref.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Andreas Karatzas <akaratza@amd.com>

@tahsintunan tahsintunan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM

Comment on lines +131 to +153
configure_kernrec_docker_args() {
kernrec_docker_args=()
[[ "$1" == *recorders/kernrec/ci_setup.sh* ]] || return 0
local checkout="${BUILDKITE_BUILD_CHECKOUT_PATH:-}"
if [[ -z "$checkout" || ! -d "$checkout" ]] ||
! mkdir -p "$checkout/.kernrec" || ! chmod 0777 "$checkout/.kernrec"; then
echo "kernrec: checkout unavailable; container recordings cannot be uploaded" >&2
kernrec_docker_args=(-e KERNREC_DISABLE=1)
return 0
fi
kernrec_docker_args=(
-v "$checkout/.kernrec:/tmp/kernrec-checkout/.kernrec"
-e "KERNREC_CHECKOUT_PATH=/tmp/kernrec-checkout"
-e BUILDKITE_JOB_ID
-e BUILDKITE_STEP_KEY
-e BUILDKITE_LABEL
-e BUILDKITE_BUILD_NUMBER
-e BUILDKITE_COMMIT
-e KERNREC_PYTHON
-e VLLM_WORKER_MULTIPROC_METHOD
-e VLLM_WORKER_SHUTDOWN_TIMEOUT_SECONDS
)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: This only runs on the dind path, and every AMD step is dind: false today. Is it still needed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, it isn't needed. Every AMD step is dind: false, so the runner exits in the native branch before it reaches docker run. The only jobs that can still be dind (no_plugin and multi-node) are already excluded from kernrec in ci-infra's _kernrec_applies. I removed the helper, the sourcing guard and tests/tools/test_amd_runner.py, so run-amd-test.sh now matches main.

else ([], [])
),
)
monkeypatch.setattr(producer, "device_dependencies", lambda *args: set())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: with this stubbed, device_dependencies never runs end to end in CI (the real-HIP test skips here). Could we mock run instead?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does run end to end in CI, just not on the CPU step. The :amd: (MI250) Docker Build Metadata mirror runs the same file on the ROCm image, and on this PR (vllm/ci 92017 and 95743) both real-HIP tests passed there, with build_map going through device_dependencies against real clang. Dropping the stub and relying on the run mock would mean faking clang's -### output and depfiles, which tests our imitation rather than clang. I'd rather keep this fixture focused on host and HIPify provenance.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, missed that the MI250 mirror runs it. Makes sense, thanks.

AndreasKaratzas and others added 3 commits October 23, 2026 02:34
Every AMD step runs natively (dind: false), so run-amd-test.sh exits
before the docker run branch, and the jobs that can still be dind are
not armed for kernrec. Remove the helper and its test; run-amd-test.sh
now matches main.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
vllm/ci #96785, the AMD kernel-recording run of this branch:
- AMD Docker Build Metadata failed collecting
  tests/tools/test_kernel_symbol_map.py: it loads
  /vllm-workspace/tools/ci/rocm_kernel_symbol_map.py, and native AMD pods
  unpack /vllm-workspace from export_vllm, which shipped only two files of
  tools/. Export tools/ci with the rest of the test workspace.
- MiniMax M3 MonoKernel runs 19.5-20 min on main against a 20 min limit, so
  any slowdown times it out (it passed every test there and was cut at
  20.5 min). Give it 40.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andreas Karatzas <AndreasKaratzas@users.noreply.github.com>
@mergify

mergify Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @AndreasKaratzas.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Oct 23, 2026
Conflict: .buildkite/test_areas/models_basic.yaml. Main now gives the
MiniMax M3 MonoKernel step 45 minutes; this branch had raised it from 20 to
40. Take main's 45, which reverts this branch's change to the file.
docker/Dockerfile.rocm merged cleanly: main's UCX v1.23.0-rc1 bump (#62827)
plus this branch's symbol-map stages and tools/ci export.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andreas Karatzas <AndreasKaratzas@users.noreply.github.com>
@mergify mergify Bot removed the needs-rebase label Oct 23, 2026
@khluu
khluu merged commit debcf22 into main Oct 24, 2026
312 of 314 checks passed
@khluu
khluu deleted the akaratza_rocm_ci_selector branch October 24, 2026 01:05
@github-project-automation github-project-automation Bot moved this from Todo to Done in AMD Oct 24, 2026
AndreasKaratzas added a commit to AndreasKaratzas/vllm that referenced this pull request Oct 24, 2026
…deployment

vllm-project#59100 exports a ROCm kernel symbol map from the old build (ci-bake-rocm.sh,
ci-rocm.hcl, kernel-symbol-map-rocm), which this branch replaces. Ported to
the new build:

- Dockerfile.rocm: CI csrc builds (ARCH set; release builds skip it) write
  the map from the build tree before removing it, with
  tools/ci/rocm_kernel_symbol_map.py, bounded and never failing the build.
  kernel-symbol-map stamps it with this build's commit, so a csrc layer
  reused from another commit still yields a map the collector accepts. The
  dev stage installs regex, which the map tool imports.
- docker-bake-rocm.hcl: a kernel-symbol-map target (local output).
- build.sh ci: with VLLM_KERNEL_SYMBOL_MAP=1 (set by ci-infra on
  image-build-amd), export and upload kernel_symbol_map.rocm.json.gz; a
  failure only warns, and a map from an earlier build is never uploaded.
- Tests: the old orchestration tests are replaced by build.sh tests in
  test_rocm_build.py; test_kernel_symbol_map.py runs in the CPU step, its
  AMD mirror and the legacy AMD step. The stale build-config.sh dependency
  is dropped and the CPU step now depends on the ROCm build files.

Signed-off-by: Andreas Karatzas <AndreasKaratzas@users.noreply.github.com>
Co-Authored-By: Claude <noreply@anthropic.com>
bantianyue pushed a commit to bantianyue/vllm that referenced this pull request Oct 28, 2026
…9100)

Signed-off-by: Andreas Karatzas <andreas.karatzas@protonmail.com>
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Signed-off-by: Andreas Karatzas <AndreasKaratzas@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Andreas Karatzas <AndreasKaratzas@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build rocm Related to AMD ROCm

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants