Skip to content

skill(infer-hw-adapt, infer-precision-check): expand backend coverage and add shared precision check skill#18

Merged
Caozhou1995 merged 6 commits into
flagos-ai:mainfrom
physics31415926:skill/infer-hw-adapt-update
Jul 13, 2026
Merged

skill(infer-hw-adapt, infer-precision-check): expand backend coverage and add shared precision check skill#18
Caozhou1995 merged 6 commits into
flagos-ai:mainfrom
physics31415926:skill/infer-hw-adapt-update

Conversation

@physics31415926

@physics31415926 physics31415926 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Two skill updates based on findings from recent backend adaptation work.

  1. infer-hw-adapt: expand backend coverage (MUSA, Sunrise, Iluvatar, Hygon, PPU, MetaX), fix duplicate content. Version numbers are runtime-detected at Stage 0, not hardcoded.
  2. infer-precision-check: new shared skill providing a standardized correctness gate for inference. Usable from model porting, hardware adaptation, plugin version upgrades, and regression detection.

Changes

infer-hw-adapt

SKILL.md

  • Add 5 new backend keywords: musa, iluvatar, sunrise, hygon, ppu
  • Expand breakage table with 7 new patterns (platform detection, patch idempotency, torch.accelerator stub, ops registry conflict, CUDAGraph timeout, FlagGems fast-path guard, MoE dispatch registration)
  • Fix duplicate content: original file contained two full copies of Stage 0–6; deduplicated to one
  • Improve Stage 4 serving test: add curl request command and monitor parameters
  • Simplify Stage 0 probe command to essential checks

SUMMARY.md

  • Add platform detection to the Load when description
  • Fix constraint rule count: 14 → 7 (aligns with actual Critical Rules list)

infer-precision-check (new skill)

SKILL.md

  • 3-tier comparison protocol: Tier 1 exact token ID → Tier 2 top-K set → Tier 3 semantic
  • 7-step workflow: env probe → prompts → GT collection (NVIDIA) → target collection → compare → multimodal → TP scaling → serving
  • Reusable Python scripts: gt_collect.py, target_collect.py, compare.py
  • Failure diagnosis guide: mismatch at token 0–2 / 3–10 / 10+ / systematic failure
  • Pass/fail checklist and PR result recording template
  • 5 constraint guards: greedy_only, gt_first, same_model_weights, log_all_outputs, tp_parity

SUMMARY.md

  • Concise card covering load-when triggers, full cycle, key principles, and tier definitions

Integration

  • infer-model-adapt calls infer-precision-check at Step 13 (after offline inference passes)
  • infer-hw-adapt calls infer-precision-check at Stage 4 (after functional tests pass)

No functional changes to agent behavior

All updates are documentation/guidance only. No code changes.


Precision Verification: Qwen3.6-27B on MetaX C550

Real-world validation run using the infer-precision-check skill on MetaX C550 hardware.

Setup

Item GT (NVIDIA A800) Target (MetaX C550)
Hardware A800-SXM4-80GB MetaX C550
Container vllm-precision-gt vllm-fl-adapt-0202
vLLM 0.20.2 (CUDA) 0.20.2+empty + vllm-plugin-fl 0.2.0
Model Qwen3.6-27B (shared weights, same files) Qwen3.6-27B (same)
Decoding greedy (temperature=0) greedy (temperature=0)
TP 1 1
max_tokens 128 128

Tier 1 Results (Exact Token ID Match)

5 prompts × 128 max tokens, greedy decoding:

# Prompt GT len MX len Result
0 What is the capital of France? 128 128 ❌ MISMATCH @ token 35
1 Explain the theory of relativity in simple terms. 128 128 ❌ MISMATCH @ token 108
2 Write a Python function to compute fibonacci numbers. 128 128 ✅ MATCH
3 What are the main differences between TCP and UDP? 128 128 ✅ MATCH
4 Translate Hello how are you into Chinese. 11 11 ✅ MATCH

Tier 1: 3/5 MATCH

Analysis

  • Prompts 2, 3, 4 achieve exact token-level match — basic compute path is correct.
  • Prompts 0 and 1 diverge late (token 35 and token 108 respectively), consistent with BF16 floating-point accumulation order differences between CUDA and MACA backends causing different greedy selections at numerically close logit positions. This is expected behavior for non-identical hardware.
  • Divergence is not at token 0–2 (would indicate weight loading or tokenizer mismatch) — weights and tokenizer are confirmed identical.
  • Tier 2 (top-K logit set match) verification was attempted but blocked by GPU memory contention on the A800 node during the test window. To be completed in a follow-up run.

Known Workaround Applied

MetaX MACA NCCL init_process_group (world_size=1) consumes ~54 GiB of device memory before vLLM's memory snapshot, causing the default gpu_memory_utilization=0.85 check to fail (free=7.54 GiB < requested=54 GiB). Fix: use kv_cache_memory_bytes=3*1024**3 to bypass the utilization-based check and directly specify KV cache size. Also requires enforce_eager=True.

@physics31415926 physics31415926 force-pushed the skill/infer-hw-adapt-update branch from 37bb53e to fb6dda0 Compare June 29, 2026 08:55
@physics31415926 physics31415926 changed the title skill(infer-hw-adapt): update for vLLM 0.20.x multi-backend adaptation skill(infer-hw-adapt): expand backend coverage and fix duplicate content Jun 29, 2026
Comment thread tmp_ms_check.py Outdated
@physics31415926 physics31415926 changed the title skill(infer-hw-adapt): expand backend coverage and fix duplicate content skill(infer-hw-adapt, infer-precision-check): expand backend coverage and add shared precision check skill Jul 6, 2026
@Caozhou1995 Caozhou1995 merged commit 5326adb into flagos-ai:main Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants