@@ -12,7 +12,7 @@ permissions:
1212
1313jobs :
1414 claude-review :
15- uses : NVIDIA-NeMo/FW-CI-templates/.github/workflows/_claude_review.yml@v1.7.0
15+ uses : NVIDIA-NeMo/FW-CI-templates/.github/workflows/_claude_review.yml@209ac7913b0419a5ccbac47b02d00fbea4939243 # v1.8.4
1616 with :
1717 model : ${{ vars.CLAUDE_MODEL }}
1818 prompt : |
@@ -107,6 +107,16 @@ jobs:
107107 - ambiguous public signatures: boolean-trap parameters, multiple
108108 same-typed positional runtime arguments that should be keyword-only,
109109 or long anonymous tuple returns that need a named typed result.
110+ - Model-specific ownership is mandatory. Model-specific logic may live
111+ only under `nemo_automodel/components/models/<model>/`. Treat logic as
112+ model-specific when it names or branches on a model or family, hard-codes
113+ its module/parameter paths or weight layout, or implements its
114+ architecture, initialization, or parallelization policy. If changed code
115+ adds or expands such logic anywhere else, including another directory
116+ under `nemo_automodel/components/` or a recipe, report a critical finding
117+ and require relocation to the owning model package. Shared components may
118+ expose generic typed contracts and invoke model-owned hooks, but must not
119+ encode model identities or model-specific policy.
110120 - Tensor contract docstrings. For every new function or method, or any
111121 function/method whose signature or tensor-handling body is materially
112122 changed, that accepts a tensor input, require its docstring to document
@@ -118,12 +128,20 @@ jobs:
118128 `nn.Parameter`, optional tensors, variadic tensors, and tensors nested in
119129 tuples/lists/mappings/dataclasses as tensor inputs. Require the Google-style
120130 `Args` section and, when values are returned, `Returns` section to document:
121- - every tensor input and output's semantic shape and axis order, with
122- symbolic dimensions defined at first use (for example, `B` = batch, `S`
123- = sequence, `H` = hidden). Flag vague descriptions such as "embedding
124- tensor" or unexplained `[B, S, H]` notation. If arbitrary ranks or
125- leading dimensions are accepted, state that explicitly and identify the
126- constrained axes (for example, `[..., H]` with `H` = hidden size);
131+ - every tensor input and output's semantic shape and axis order. Follow
132+ the common format `hidden_states: Tensor of shape [batch, sequence,
133+ hidden].` Use clear, conventional dimension names such as `batch`,
134+ `sequence`, `tokens`, `hidden`, `heads`, `channels`, and `vocab` without
135+ explaining them. Define non-obvious or model-specific dimension names at
136+ first use. Flag vague descriptions such as "embedding tensor" or
137+ layouts that do not follow this format. If arbitrary ranks or leading
138+ dimensions are accepted, state that explicitly and identify the
139+ constrained axes (for example, `hidden_states: Tensor of shape [...,
140+ hidden], with arbitrary leading dimensions.`). When reporting a layout
141+ documentation finding, include a concrete compliant rewrite in the
142+ review; for example, `fused_qkv: Tensor of shape [batch, sequence, 3,
143+ heads, head_dim], where axis 2 stores query, key, and value in that
144+ order.`;
127145 - nonstandard logical layout such as packed, padded, ragged, flattened,
128146 interleaved, fused-QKV/GateUp, THD, or channels-first/channels-last, and
129147 the before/after layout when the API transforms it;
@@ -163,6 +181,29 @@ jobs:
163181 that class's nested `ModelCapabilities` dataclass (static pattern) or
164182 inside the `get_capabilities(cls, config)` classmethod (dynamic
165183 dispatch pattern).
184+ - Checkpoint-free model initialization. When a PR adds or materially
185+ changes model parameters, persistent buffers, initialization methods,
186+ routing state, or a random-init recipe path, verify that construction
187+ followed by the production initialization path leaves every tensor that
188+ can affect the first forward/backward in a valid state without loading a
189+ checkpoint:
190+ - flag parameters or persistent buffers allocated with `torch.empty`, or
191+ initialized to sentinel/placeholder values, unless every supported
192+ model variant and stage (including auxiliary heads and MTP blocks)
193+ overwrites them before use. A later checkpoint load is not a substitute
194+ when checkpoint-free or random-init training is supported;
195+ - require routing/index tables to satisfy the downstream dispatcher's
196+ structural invariants before first use: indices must be in range and,
197+ when the dispatcher requires it (for example DeepEP top-k routing),
198+ expert IDs for each token must be distinct. An all-zero placeholder is
199+ valid only when it satisfies the actual routing contract;
200+ - require a focused test that disables checkpoint/base-model loading,
201+ invokes the production initializer, and asserts finite initialized
202+ parameters plus the relevant buffer/routing invariants. When this state
203+ affects execution or gradients, also require a finite first
204+ forward/backward on the smallest representative backend/topology; apply
205+ the distributed test matrix below when a single-process backend cannot
206+ exercise the contract.
166207 - Low-precision dtype hazards in RoPE / precision-sensitive buffers. Flag
167208 when a module registers a floating-point buffer used to build rotary
168209 tables — `inv_freq`, `freqs_cis`, or precomputed `cos`/`sin` — and the
0 commit comments