Final review report · NVIDIA/hyperflare-inference #533

Raw Markdown for agents: https://autobot.eidonix.com/p/eaa0f7c6-cad5-44fd-9112-96fa73aad9a3.md

Recommendation: Ready To Merge

All prior blockers and earlier review items are resolved at 503a438: the change cleanly adds --request-context via one declarative RecipeParameters field, one Plan.prepared_context accessor, and one preparation seam (ignition/preparation/bootstrap.py:132), with full parity across single-host export, multi-host export, ignition bench, and --direct serving, no Helios changes, and exact no-op behavior when unset. No blocking defects remain; one non-blocking display mismatch introduced during the rebase onto #212 (status_parts using context.recipe.context instead of _declared_context_limit) and two small simplifications are noted below for an optional quick follow-up.

Merge Risk

Level: Low

Walkthrough

Pre-merge Checks

Blockers

None.

Should Fix

  1. ignition/parameters.py:1606-1607 — status_parts() ignores checkpoint-declared / adjust_context-scaled ceilings (rebase mismatch with #212) and lacks a context.recipe is None guard:
    • Currently:
      if self.context_target is not None:
          parts.append(f"request context {min(self.context_target, context.recipe.context):,} tokens")
      
    • After #212, Plan.declared_context resolves via adjust_context(recipe.base_context(checkpoint), ctx) (ignition/planning.py:363-365, mirrored by _declared_context_limit at ignition/parameters.py:1299-1304). For a checkpoint with a larger checkpoint.context (e.g., 1,048,576 over a 262,144 recipe, as in tests/cli/test_planning.py:462) or an adjust_context hook (:527), passing --request-context 524288 prints request context 262,144 tokens in the Select GPUs status line even though prepared_context and the exported core serve 524,288 tokens. In addition, ParameterContext.recipe defaults to None (ignition/parameters.py:126), so direct calls without a recipe raise AttributeError, and oversized no-op targets still print even though ignition/cli/serve.py:74 suppresses the cap hint when inactive.
    • Fix: Reuse _declared_context_limit(self, ctx) and only emit when the cap is active (or recipe is absent):
      if self.context_target is not None:
          declared = _declared_context_limit(self, ctx)
          if declared is None or self.context_target < declared:
              parts.append(f"request context {self.context_target:,} tokens")
      

Subtract / Simplify

  1. ignition/planning.py:368-370, :222, :626-629 — make Plan.context cap-aware (return min(self.prepared_context, self.tokens)):
    • Plan.context is documented as "The longest sequence one request may reach", yet currently ignores prepared_context (min(self.declared_context, self.tokens)), forcing both guards at :222 and :626 to repeat min(context, prepared_context) and causing Plan.to_dict()["context"] (:407) to report the uncapped context even when --request-context is active. Changing :370 to return min(self.prepared_context, self.tokens) removes both min(...) wrappers and the effective local while keeping "prepared_context" in to_dict() (which remains distinct from "context" whenever self.tokens < self.prepared_context).
  2. ignition/planning.py:198-200 — check self.prepared_context % self.page_tokens directly:
    • Replace if target is not None and target <= self.declared_context and target % self.page_tokens: with if target is not None and self.prepared_context % self.page_tokens: (formatting self.prepared_context in the message). Keeps the target is not None guard so an unset flag never emits a --request-context error, drops the redundant range comparison, and validates the exact value passed to common_preparation_kwargs and Helios (helios/src/model/catalog.rs:48-55).

Nits

Dropped on verification