-
Notifications
You must be signed in to change notification settings - Fork 195
[DO NOT MERGE] [Klaud Cold] experimental: profile MiniMax-M3 MI325X conc 4/8 — vllm#45639 (AITER AR + Gemma-RMS fusion) #1773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
functionstackx
wants to merge
4
commits into
main
from
experimental/profile-minimaxm3-mi325-arfusion-45639-dnm
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
397f637
[DO NOT MERGE] experimental: M3 MI325X conc 4/8 with vllm#45639 patch…
functionstackx 65be443
perf-changelog: fill in PR link for minimaxm3arf-fp8-mi325x-vllm (#1772)
functionstackx 50f9cec
[DO NOT MERGE] experimental: profile M3 MI325X conc 4/8 with vllm#456…
functionstackx edfa135
trigger label-gated profile run (synchronize with profile-enabled pre…
functionstackx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Target for the label-triggered Profile workflow (.github/workflows/profile.yml). | ||
| # When a PR carries the 'profile-enabled' label, that workflow profiles this | ||
| # config-key and emits a Perfetto trace per (concurrency, tp) (artifact + relay | ||
| # link in the run summary). CONC is space-separated; the workflow runs one job | ||
| # per (conc, tp) — i.e. both TP4 and TP8 at each conc. | ||
| # | ||
| # Experiment: MiniMax-M3 MXFP8 on MI325X (gfx942) with vllm-project/vllm#45639 | ||
| # (AITER AR + Gemma-RMS fusion) applied in-place; single-node vLLM, TP8, conc 4 and 8. | ||
| CONFIG_KEY=minimaxm3arf-fp8-mi325x-vllm | ||
| CONFIG_FILE=.github/configs/amd-master.yaml | ||
| CONC=4 8 |
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
129 changes: 129 additions & 0 deletions
129
benchmarks/single_node/fixed_seq_len/minimaxm3arf_fp8_mi325x.sh
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # [DO NOT MERGE — experimental] MiniMax-M3 MXFP8 MI325X (gfx942) single-node vLLM | ||
| # recipe that validates vllm-project/vllm#45639 ("[ROCm][M3] Enable AITER AR + | ||
| # Gemma-RMS fusion for MiniMax-M3") on real MI325X hardware before an image | ||
| # rebuild. It applies #45639 in-place to the shipped vllm/vllm-openai-rocm:minimax-m3 | ||
| # image, then serves with the AITER fused all-reduce + RMSNorm path enabled. | ||
| # | ||
| # Mirrors minimaxm3_fp8_mi325x.sh otherwise (--block-size 128, --language-model-only, | ||
| # TRITON_ATTN, BF16 KV — gfx942 has no calibrated FP8 attention scales). The | ||
| # #45639-specific knobs: | ||
| # VLLM_ROCM_USE_AITER=1 (AITER kernels) | ||
| # --compilation-config custom_ops=["-minimax_gemma_rms_norm"] (allow IR lowering) | ||
| # --compilation-config pass_config.fuse_allreduce_rms=true (the fusion pass) | ||
| # The fusion needs TP>1; this recipe is swept at TP8. | ||
|
|
||
| source "$(dirname "$0")/../../benchmark_lib.sh" | ||
|
|
||
| check_env_vars \ | ||
| MODEL \ | ||
| TP \ | ||
| EP_SIZE \ | ||
| DP_ATTENTION \ | ||
| CONC \ | ||
| ISL \ | ||
| OSL \ | ||
| MAX_MODEL_LEN \ | ||
| RANDOM_RANGE_RATIO \ | ||
| RESULT_FILENAME | ||
|
|
||
| if [[ -n "$SLURM_JOB_ID" ]]; then | ||
| echo "JOB $SLURM_JOB_ID running on $SLURMD_NODENAME" | ||
| fi | ||
|
|
||
| if [[ "$MODEL" != /* ]]; then hf download "$MODEL"; fi | ||
|
|
||
| if [ -n "$ROCR_VISIBLE_DEVICES" ]; then | ||
| export HIP_VISIBLE_DEVICES="$ROCR_VISIBLE_DEVICES" | ||
| fi | ||
|
|
||
| # ---- Apply vllm-project/vllm#45639 in-place ------------------------------- | ||
| # The shipped minimax-m3 image predates #45639 (base m3_release). Apply the | ||
| # vendored diff to the installed vllm. Idempotent: if it is already applied | ||
| # (reverse-applies cleanly) we proceed; if it neither applies cleanly nor is | ||
| # already applied, the image has drifted from the PR base — hard-fail so we never | ||
| # silently benchmark an unpatched server. | ||
| PATCH_FILE="$(cd "$(dirname "$0")/patches" && pwd)/vllm-45639-aiter-ar-gemma-rms.diff" | ||
| command -v patch >/dev/null 2>&1 || { apt-get update -q -y && apt-get install -q -y patch; } | ||
| VLLM_SP="$(python3 -c 'import os, vllm; print(os.path.dirname(os.path.dirname(vllm.__file__)))')" | ||
| if ( cd "$VLLM_SP" && patch -p1 -R --dry-run < "$PATCH_FILE" >/dev/null 2>&1 ); then | ||
| echo "[vllm#45639] already applied to $VLLM_SP/vllm" | ||
| elif ( cd "$VLLM_SP" && patch -p1 --dry-run < "$PATCH_FILE" >/dev/null 2>&1 ); then | ||
| ( cd "$VLLM_SP" && patch -p1 < "$PATCH_FILE" ) | ||
| echo "[vllm#45639] applied to $VLLM_SP/vllm" | ||
| else | ||
| echo "FATAL: vllm#45639 patch neither applies cleanly nor is already applied" >&2 | ||
| echo " ($VLLM_SP/vllm has drifted from the PR's m3_release base)" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| SERVER_LOG=/workspace/server.log | ||
| export VLLM_ENGINE_READY_TIMEOUT_S=3600 | ||
| export VLLM_USE_BREAKABLE_CUDAGRAPH=0 | ||
| # #45639: AITER fused all-reduce + Gemma-RMSNorm. | ||
| export VLLM_ROCM_USE_AITER=1 | ||
|
|
||
| if [ "${EVAL_ONLY}" = "true" ]; then | ||
| setup_eval_context | ||
| fi | ||
|
|
||
| PARALLEL_ARGS=(--tensor-parallel-size "$TP") | ||
| if [ "${DP_ATTENTION}" = "true" ]; then | ||
| PARALLEL_ARGS=( | ||
| --tensor-parallel-size 1 | ||
| --data-parallel-size "$TP" | ||
| --enable-expert-parallel | ||
| ) | ||
| elif [ "$EP_SIZE" -gt 1 ]; then | ||
| PARALLEL_ARGS+=(--enable-expert-parallel) | ||
| fi | ||
|
|
||
| start_gpu_monitor | ||
|
|
||
| # When PROFILE=1 (profile.yml), arm vLLM's torch profiler via --profiler-config. | ||
| # This minimax-m3 image's vLLM does NOT honour the VLLM_TORCH_PROFILER_DIR env | ||
| # var, so the serve flag is what makes /start_profile emit a trace. Write to the | ||
| # dir benchmark_lib's relay scans (VLLM_TORCH_PROFILER_DIR, default /workspace/). | ||
| PROFILE_ARGS=() | ||
| if [ "${PROFILE:-}" = "1" ]; then | ||
| PROFILE_ARGS=(--profiler-config "{\"profiler\": \"torch\", \"torch_profiler_dir\": \"${VLLM_TORCH_PROFILER_DIR:-/workspace/}\"}") | ||
| fi | ||
|
|
||
| set -x | ||
| vllm serve "$MODEL" --port "$PORT" \ | ||
| "${PARALLEL_ARGS[@]}" \ | ||
| "${PROFILE_ARGS[@]}" \ | ||
| --block-size 128 \ | ||
| --language-model-only \ | ||
| --max-model-len "$MAX_MODEL_LEN" \ | ||
| --attention-backend TRITON_ATTN \ | ||
| --no-enable-prefix-caching \ | ||
| --compilation-config '{"custom_ops": ["-minimax_gemma_rms_norm"], "pass_config": {"fuse_allreduce_rms": true}}' \ | ||
| --tool-call-parser minimax_m3 \ | ||
| --reasoning-parser minimax_m3 \ | ||
| --enable-auto-tool-choice > "$SERVER_LOG" 2>&1 & | ||
|
|
||
| SERVER_PID=$! | ||
| wait_for_server_ready --port "$PORT" --server-log "$SERVER_LOG" --server-pid "$SERVER_PID" | ||
|
|
||
| run_benchmark_serving \ | ||
| --model "$MODEL" \ | ||
| --port "$PORT" \ | ||
| --backend vllm \ | ||
| --input-len "$ISL" \ | ||
| --output-len "$OSL" \ | ||
| --random-range-ratio "$RANDOM_RANGE_RATIO" \ | ||
| --num-prompts "$((CONC * 10))" \ | ||
| --max-concurrency "$CONC" \ | ||
| --result-filename "$RESULT_FILENAME" \ | ||
| --result-dir /workspace/ \ | ||
| --trust-remote-code | ||
|
|
||
| if [ "${RUN_EVAL}" = "true" ]; then | ||
| run_eval --framework lm-eval --port "$PORT" | ||
| append_lm_eval_summary | ||
| fi | ||
|
|
||
| stop_gpu_monitor | ||
| set +x |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR traces use merge SHA
Medium Severity
Label-triggered profiling checks out the PR head commit via
needs.get-jobs.outputs.ref, but trace storage paths, commit messages, and Perfetto raw URLs still useGITHUB_SHA. Onpull_requestruns that SHA is GitHub’s synthetic merge commit, not the profiled head, so artifacts and relay links won’t align with the PR revision that was actually run.Additional Locations (1)
.github/workflows/profile.yml#L325-L326Reviewed by Cursor Bugbot for commit edfa135. Configure here.