Skip to content

Commit 50ee296

Browse files
committed
chore(cute): remove development artifacts from Neo PR
1 parent 66dbd31 commit 50ee296

27 files changed

Lines changed: 52 additions & 117 deletions

deepmd/kernels/cute/neo/gie.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
produces radial, zonal/Wigner, source-gate, and degree-normalization gradients
1212
without an edge-by-row-by-channel temporary.
1313
14-
``DP_NEO_CUTE_INFER`` is the master opt-in. The SM80/SM86 path is the
15-
default there, while ``DP_CUTE_GIE=0`` remains a diagnostic kill switch.
14+
``DP_NEO_CUTE_INFER`` is the master opt-in. The SM80/SM86 path enables this
15+
fusion by default; ``DP_CUTE_GIE=0`` disables it explicitly.
1616
"""
1717

1818
from __future__ import annotations
@@ -90,8 +90,8 @@ def _standard_index_contract(module: Any, lmax: int, row_count: int) -> bool:
9090
if rows.dtype != torch.long or slots.dtype != torch.long:
9191
return False
9292

93-
# These buffers are constructor-owned and immutable in normal execution.
94-
# Check values on CPU tests, but avoid a device synchronization in inference.
93+
# These buffers are constructor-owned and immutable. Validate their values
94+
# when host-resident without introducing a CUDA synchronization.
9595
if rows.device.type == "cpu" and slots.device.type == "cpu":
9696
expected_rows = torch.arange(
9797
1, row_count + 1, dtype=torch.long, device=torch.device("cpu")

deepmd/kernels/cute/neo/k1.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def _dtypes_use_strict_fp32(dtypes: Any) -> bool:
275275
def is_supported_k1_compute_capability(
276276
compute_capability: tuple[int, int],
277277
) -> bool:
278-
"""Return whether the production K1 path has been validated on this GPU."""
278+
"""Return whether K1 supports this compute capability."""
279279
return runtime_policy.is_supported_k1_capability(compute_capability)
280280

281281

@@ -295,8 +295,8 @@ def _tensor_compute_capability(tensor: Any) -> tuple[int, int] | None:
295295

296296

297297
def _device_is_supported_for_k1(device: torch.device) -> bool:
298-
# CPU-only contract tests use a synthetic CUDA device. Real CUDA dispatch
299-
# always has an available runtime and must match a validated architecture.
298+
# Metadata-only eligibility checks may use a CUDA device on a host without
299+
# a CUDA runtime. Concrete CUDA dispatch always validates the capability.
300300
return not torch.cuda.is_available() or is_supported_k1_compute_capability(
301301
_device_compute_capability(device)
302302
)
@@ -431,7 +431,6 @@ def __init__(
431431
try:
432432
self._block_ref = weakref.ref(block, on_collect)
433433
except TypeError:
434-
# Lightweight contract tests use plain object() sentinels.
435434
self._block_ref = lambda: block
436435
self.config = config
437436

deepmd/kernels/cute/neo/k1_kernels/cute_neo_phase_c_backward_layout_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def _compile_layout_boundary(
136136

137137

138138
class CuteNeoPhaseCBackwardLayout:
139-
"""Validated callable for the fused node-owned Phase-C boundary.
139+
"""Callable for the fused node-owned Phase-C boundary.
140140
141141
One invocation replaces Phase-C backward, envelope-softmax backward plus
142142
its z reduction, and focus-source backward. The Phase-C residual adjoint

deepmd/kernels/cute/neo/k1_kernels/cute_neo_phase_c_onepass.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: LGPL-3.0-or-later
33
"""Strict-FP32 one-pass Neo Phase-C forward with output gating.
44
5-
This module specializes the production Neo shape ``D=16, Dm=10, F=2,
5+
This module specializes the supported Neo shape ``D=16, Dm=10, F=2,
66
C=32``. One 64-thread CTA owns one destination CSR row. Lane
77
``focus * 32 + channel`` sweeps every edge in that row and retains its 16
88
output-degree accumulators in a CuTe register fragment. Wigner values are
@@ -54,7 +54,7 @@
5454

5555
@dataclass(frozen=True)
5656
class NeoPhaseCOnePassParams:
57-
"""Runtime tensors for the validated warp-private packed kernel."""
57+
"""Runtime tensors for the warp-private packed kernel."""
5858

5959
x_local: cute.Tensor
6060
wigner_dt: cute.Tensor
@@ -196,7 +196,7 @@ def neo_phase_c_onepass_output_gate_packed_direct_warp_private_kernel(
196196
accumulator_layout: cute.Layout,
197197
eps: cutlass.Constexpr[float],
198198
):
199-
"""Triton-style final store with no Wigner shared-memory round trip."""
199+
"""Store the gated output without a Wigner shared-memory round trip."""
200200
tid, _, _ = cute.arch.thread_idx()
201201
node, _, _ = cute.arch.block_idx()
202202
focus = tid // CHANNELS
@@ -395,7 +395,7 @@ def _fake_common_tensors():
395395
def compile_neo_phase_c_onepass_output_gate(
396396
eps: float,
397397
) -> Callable:
398-
"""Compile the validated packed, focus-major, warp-private specialization."""
398+
"""Compile the packed, focus-major, warp-private specialization."""
399399
if not (eps > 0.0 and eps < float("inf")):
400400
raise ValueError("output-gate RMSNorm eps must be finite and positive")
401401
common_args = _fake_common_tensors()

deepmd/kernels/cute/neo/k1_kernels/cute_neo_so2_gate_combined_fwd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ def _compile_combined_forward(
637637
compute_capability: tuple[int, int],
638638
) -> Callable:
639639
if not _supports_combined_forward(compute_capability):
640-
raise RuntimeError("combined forward requires a validated compute capability")
640+
raise RuntimeError("combined forward requires a supported compute capability")
641641
with torch.cuda.device(device_index):
642642
fake_x = _fake_focus_tensor(FULL_WIDTH)
643643
fake_residual = _fake_focus_tensor(FULL_WIDTH)
@@ -709,7 +709,7 @@ def __init__(
709709
compute_capability = tuple(torch.cuda.get_device_capability(device_index))
710710
if not _supports_combined_forward(compute_capability):
711711
raise RuntimeError(
712-
"combined forward requires a validated compute capability"
712+
"combined forward requires a supported compute capability"
713713
)
714714

715715
packed_w0, packed_wp, packed_gate = packed_weights

deepmd/kernels/cute/neo/k1_radial_phase_a_node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ def build_source_csr(
5050
) -> NeoSourceCSR:
5151
"""Build indirect source CSR without changing the physical edge order.
5252
53-
``validate_sources=True`` synchronizes when ``src`` is CUDA. Production
54-
callers should build this once with the edge cache and retain both tensors.
53+
``validate_sources=True`` synchronizes when ``src`` is CUDA. Callers should
54+
build this once with the edge cache and retain both tensors.
5555
"""
5656
import torch
5757

deepmd/kernels/cute/neo/k1_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def _validate_runtime_config(
2929
compute_capability: tuple[int, int] | None = None,
3030
) -> None:
3131
if compute_capability not in SUPPORTED_K1_CAPABILITIES:
32-
raise RuntimeError("Neo K1 requires a validated compute capability")
32+
raise RuntimeError("Neo K1 requires a supported compute capability")
3333
if runtime_config.native_sm90_path != (compute_capability == SM90_CAPABILITY):
3434
raise RuntimeError("the native SM90 K1 path must be selected only on sm_90")
3535
if runtime_config.per_focus_so2_fwd_pair != (

deepmd/kernels/cute/neo/k1_wigner_layout.py

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
from dataclasses import dataclass
1313
from typing import TYPE_CHECKING
1414

15-
import torch
16-
1715
if TYPE_CHECKING:
1816
from collections.abc import Iterator
1917

@@ -85,39 +83,3 @@ def iter_packed_entries() -> Iterator[PackedWignerEntry]:
8583
full_row=full_row,
8684
full_col=block_start + local_col,
8785
)
88-
89-
90-
def pack_dense_reference(d_full: torch.Tensor) -> torch.Tensor:
91-
"""Gather a dense block-diagonal matrix for CPU differential tests only."""
92-
entries = tuple(iter_packed_entries())
93-
rows = [entry.full_row for entry in entries]
94-
cols = [entry.full_col for entry in entries]
95-
return d_full[..., rows, cols]
96-
97-
98-
def phase_a_reference(panel: torch.Tensor, x_wide: torch.Tensor) -> torch.Tensor:
99-
"""Reference ``D[coeff_index_m] @ x_wide`` without dense unpacking."""
100-
outputs = []
101-
for reduced, degree in enumerate(REDUCED_DEGREES):
102-
block_start = FULL_BLOCK_OFFSETS[degree]
103-
block_stop = FULL_BLOCK_OFFSETS[degree + 1]
104-
row_start = REDUCED_PANEL_ROW_OFFSETS[reduced]
105-
values = panel[..., row_start : row_start + block_stop - block_start]
106-
x_block = x_wide[..., block_start:block_stop, :]
107-
outputs.append((values.unsqueeze(-1) * x_block).sum(dim=-2))
108-
return torch.stack(outputs, dim=-2)
109-
110-
111-
def phase_c_reference(panel: torch.Tensor, x_local: torch.Tensor) -> torch.Tensor:
112-
"""Reference ``Dt[:, :, coeff_index_m] @ x_local`` from the same panel."""
113-
outputs = []
114-
for full_row in range(FULL_BLOCK_OFFSETS[-1]):
115-
value = torch.zeros_like(x_local[..., 0, :])
116-
for reduced in range(len(COEFF_INDEX_M)):
117-
offset = dt_offset(full_row, reduced)
118-
if offset is not None:
119-
value = (
120-
value + panel[..., offset].unsqueeze(-1) * x_local[..., reduced, :]
121-
)
122-
outputs.append(value)
123-
return torch.stack(outputs, dim=-2)

deepmd/kernels/cute/neo/output_grid_product.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: LGPL-3.0-or-later
3-
"""Strict-FP32 CuTe middle contractions for validated Neo grid MLPs."""
3+
"""Strict-FP32 CuTe middle contractions for supported Neo grid MLPs."""
44

55
from __future__ import annotations
66

deepmd/kernels/cute/neo/runtime_policy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def _sm80_profile_feature(
113113
name: str,
114114
compute_capability: tuple[int, int] | None = None,
115115
) -> bool:
116-
"""Apply an SM80-family default with an environment kill switch."""
116+
"""Apply an SM80-family default with an explicit disable override."""
117117
if not is_sm80_profile_enabled(compute_capability):
118118
return False
119119
return _env_override(name) is not False
@@ -208,14 +208,14 @@ def is_readout_input_fold_sm90_enabled(
208208
def is_readout_input_fold_enabled(
209209
compute_capability: tuple[int, int] | None = None,
210210
) -> bool:
211-
"""Select the validated architecture-specific frozen readout fold."""
211+
"""Select the architecture-specific frozen readout fold."""
212212
return is_readout_input_fold_sm80_enabled(
213213
compute_capability
214214
) or is_readout_input_fold_sm90_enabled(compute_capability)
215215

216216

217217
def is_supported_k1_capability(compute_capability: tuple[int, int]) -> bool:
218-
"""Return whether K1 has a validated production profile on this GPU."""
218+
"""Return whether K1 supports this compute capability."""
219219
return tuple(compute_capability) in SUPPORTED_K1_CAPABILITIES
220220

221221

0 commit comments

Comments
 (0)