Skip to content

Retarget prompts to the actual validating GPU architecture (root cause) - #54

Merged
ai-hpc merged 1 commit into
mainfrom
feat/reconcile-prompt-arch-to-gpu
Jul 26, 2026
Merged

Retarget prompts to the actual validating GPU architecture (root cause)#54
ai-hpc merged 1 commit into
mainfrom
feat/reconcile-prompt-arch-to-gpu

Conversation

@ai-hpc

@ai-hpc ai-hpc commented Jul 26, 2026

Copy link
Copy Markdown
Member

The root-cause fix for the dataset-quality thread (#51 prompt nudge, #53 guard-removal flag). It removes the mismatch that causes the validator-hack rather than mitigating it.

Problem

Prompts bake a GPU/SM label at build time (gpu_architecturesm_label). A miner can validate on a different GPU than the prompt declared — e.g. magicrails's "Hopper SM90" translation prompts were validated on Blackwell SM120 (RuntimeError: targets Hopper SM90, found SM120). The teacher, told "Hopper SM90", adds an SM guard that then fails, and the repair "passes" by deleting it.

Fix

sparkproof-triton-generate now:

  1. Detects the GPU it validates on (require_supported_gpu(args.gpu)["gpu_architecture"]), once.
  2. For each prompt whose declared gpu_architecture differs, calls build_prompts.reconcile_prompt_architecture — rewrites the SM label in the system/prompt text and sets gpu_architecture to the real GPU.
  3. Logs how many prompts were retargeted.

Now the teacher is always prompted for the actual hardware, so the SM-guard failure class doesn't arise in the first place, and the dataset is labeled with the real arch. No-op when the declared arch already matches, or when no GPU is detectable (dev/CPU falls back cleanly, reconciliation disabled).

Tests (+4, 370 total, ruff clean)

test_arch_reconcile.py: retarget hopper→blackwell (label rewritten in system+prompt, gpu_architecture updated), no-op on match, no-op without a declared arch, and same-label archs (h100→h200) update only the arch field.

Branches from main; independent of the held Kimi PR (#50). With this, the mismatch is fixed at the source — #53's guard-removal counter should trend to zero on correctly-configured runs.

Root-cause fix for the task-label vs hardware mismatch behind the guard-removal
validator-hacks: prompts bake a GPU/SM label at build time, but a miner can
validate on a different GPU than the prompt declared (e.g. "Hopper SM90" prompts
run on Blackwell SM12x). The teacher is then asked for the wrong arch, adds an
SM/capability guard, and it fails validation — leading to a repair that "passes"
by deleting the guard.

sparkproof-triton-generate now detects the validating GPU (require_supported_gpu)
and, per prompt, calls build_prompts.reconcile_prompt_architecture to rewrite the
SM label in the system/prompt text and set gpu_architecture to the real GPU. No-op
when the declared arch matches or no GPU is detectable (dev/CPU falls back cleanly).
Prints how many prompts were retargeted.

Complements #51 (portable-prompt nudge) and #53 (guard-removal flag) by removing
the mismatch at the source. Tests cover reconcile (retarget, no-op match, no-arch,
same-label arch-field-only update).
@ai-hpc
ai-hpc merged commit e5d5e4e into main Jul 26, 2026
1 check passed
@ai-hpc
ai-hpc deleted the feat/reconcile-prompt-arch-to-gpu branch July 26, 2026 09:11
@ai-hpc ai-hpc mentioned this pull request Jul 26, 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.

1 participant