Review of the Warp backend on the port branch (commits e812de1cb, 2aff9356f), and its first
version as shared inference infrastructure in newton-neural. NVIDIA L40, Warp 1.17.0, PyTorch 2.11.0+cu128. 2026-12-02.
Main result. The matrix kernels are correct and are true float32. But the network in Warp alone does not make the step faster. The port's 3 times faster step came from the kernels around the network: the node inputs, the update and the history. Those kernels implement the rigid method that was removed, so they must be written again before they can move.
ankac/neio-port-impl, range 8d666ead3..2aff9356f: 2,341 added lines in 12 files.experiments/neio/warp_network.py (213 lines): the network as recorded Warp launches.experiments/neio/warp_optimizer.py (600 lines): node inputs, update, history and a cache of recorded launches.solver.py, learned.py, rigid.py, deformable.py: the switch inference="warp".tests/test_warp.py (6 tests), benchmark.py, two result files.Method: I read the complete range, traced the data through each mode, wrote down candidate findings, and then ran probes on the port and measurements on the moved code. The port branch has no pull request and no earlier review, so the commit messages and the README are the stated intent. I did not rerun the port's own test file.
WarpNetwork walks the layers of the PyTorch network and records one Warp launch per layer
(record_cmd=True). The weights are read in place from the PyTorch parameters. A step replays the launches.wp.tile_matmul. A tile that reaches past the array reads zeros.P0 blocks the move. P1 should be handled before a merge. P2 is an observation or a question. "Shown" means a probe or a measurement confirms it. "Read" means it follows from the code and was not run.
| # | Priority | Where | Problem | Impact | Evidence |
|---|---|---|---|---|---|
| 1 | P0 for the move | warp_optimizer.py: _rigid_gradient, _rigid_features,
_rigid_features_small, _rigid_update, _prepare_commit |
The rigid kernels implement the rigid method that newton-neural removed: lever, arc unit, six step scales, one gradient RMS over six columns, the update as history, no turn of the history with the body. | They cannot be carried. The retrained method needs new kernels: force and torque RMS per articulation, two step scales, the direction as history, history transport, carry bound. | Read, against newton_neural/_src/neio/rigid.py. |
| 2 | P1 | README.md, acceleration_results.json, benchmark.py |
The speed claim is about the whole Warp path. The network kernels give a small part of it. The benchmark has 6 bodies and 1,089 particles only, and compares with PyTorch float32, not with TF32. | A reader takes the matrix kernels for the source of the gain. At scale they are not faster than PyTorch. | Shown. Port's own phase times, chain: network 0.054 to 0.037 ms; inputs with network 0.144 to 0.048 ms; history 0.061 to 0.008 ms. Section 5 has the measurement on the moved code. |
| 3 | P1 | solver.py, six places |
The solver tests inference == "warp" and calls private members of the optimizer (_warp.filter_update,
_warp.select_truncated, _warp.add_displacement). |
Two code paths in every phase of the step. An own optimizer cannot use the fast path through iterate and
commit. | Read. |
| 4 | P1 | warp_network.py:137-203 |
The structure of the network is written a second time. Nothing at run time compares it with NeIONetwork.forward. |
A change to one of the two gives a wrong result without an error. | Read. Only the tests compare the two. |
| 5 | P1 | warp_network.py:126, :118-121 |
On the CPU the kernel build fails: an argument of _controller is named new. There is no check and no
message for the CPU. Past that, _pool steps by the number 32 while a tiled launch has one thread per block on the
CPU. |
inference="warp" on a CPU model ends with "CPU kernel build failed". With the name fixed, the group mean would
sum one node in 32. | Build failure shown by probe. The wrong sum is read, not run. |
| 6 | P1 | _linear_kernel with tile_matmul |
The first use with an empty kernel cache is slow. The result files report times with a warm cache only. | About 100 s before the first step of a cloth-size network on a new machine or after a Warp update. | Shown on the moved code: 100.1 s for the deformable network with 1,089 nodes, 1.7 s for the rigid network with 6 bodies, under 1 s with a warm cache. |
| 7 | P2 | warp_network.py: view |
wp.from_torch gives each parameter that trains a gradient array. |
None in the port, whose loader turns the gradients off. A shared layer would double the parameter memory of a model that trains. | Shown: 24 of 24 parameters had a .grad tensor after the build. |
| 8 | P2 | warp_network.py:83, :145-175 |
The layer norm uses 1e-5 and not the value of the layer. A layer without bias, another activation or another GELU form is not refused. | Wrong numbers for a network other than the two of NeIO. | Read. |
| 9 | P2 | warp_network.py:160-168 |
The tile sizes are numbers measured for the widths 96 and 384 on one L40. The rigid width 192 uses a default. | No evidence for other widths or other GPUs. | Read. |
| 10 | P2 | tests/test_warp.py |
The tests need CUDA and are skipped without it. The largest cases have 33 bodies and 257 particles. | No coverage on a CPU-only CI runner, none for large models. | Read. |
| 11 | P2 | _LaunchCache, solver.py |
When one optimizer uses Warp, all force launches of the solver go through the cache, also for the other optimizer. The cache key is the kernel, so two call sites of one kernel bind their arguments again on every call. | A question on scope, not a defect. The port measured its effect on a captured step as 8 % and 4 %. | Read. |
Fits if narrowed. The layer is small, has no new dependency, and gives newton-neural a network path without PyTorch operators. But the layer alone brings no speed, and the part that brings speed is bound to one optimizer. The narrow form: an opt-in backend, checked against PyTorch on its first call, with the kernels around the network as the next step.
| Port | newton-neural, branch ankac/neio-warp-inference | |
|---|---|---|
| Place | WarpNetwork, built for NeIONetwork only |
WarpInference in newton_neural/_src/core/warp_inference.py, public in newton_neural.models.
Methods: linear, layer_norm, sequential, segment_mean, launch, run. |
| Network structure | Second copy inside the Warp class | record_warp_inference next to NeIONetwork.forward |
| Switch | inference="warp" per optimizer, six branches in the solver |
SolverNeIO(backend="warp") beside precision and compile. No branch in the step. |
| Check at run time | none | The first network call is compared with the eager PyTorch network (limit 1e-4) |
| CPU | build fails | works, tested |
| Parameters that train | get a gradient array | no gradient array, tested |
| Layer it does not have | not checked | raises at build time, tested |
| Other models | none | A test runs the layers of BackboneMLP through sequential. NeRDStepper is not wired. |
| Kernels around the network, launch cache | present | not carried (findings 1 and 11) |
One captured step with 10 iterations, median of 7 samples of 10 replays, one run, GPU otherwise idle. The node inputs, the update and the history are PyTorch code in all four columns.
| Scene | PyTorch fp32 | PyTorch tf32 | PyTorch tf32 compiled (default) | Warp fp32 |
|---|---|---|---|---|
| Chain, 6 bodies | 3.09 ms | 3.27 ms | 3.03 ms | 2.93 ms |
| Cloth, 1,089 particles | 2.55 ms | 2.36 ms | 2.18 ms | 2.47 ms |
| Cloth, 10,201 particles | 6.27 ms | 5.13 ms | 4.88 ms | 6.83 ms |
| Cloth, 100,489 particles | 53.2 ms | 43.0 ms | 39.0 ms | 54.3 ms |
For comparison, the port with all kernels (its own numbers, same GPU type): chain of 6 bodies 2.30 ms to 0.69 ms, cloth of 1,089 particles 2.55 ms to 1.41 ms.
backend on the solver with the values "torch" and "warp". Or per
optimizer, as in the port?NeRDStepper. Its network has attention, a normalizer and an integration step, which the layer does not
have. Wire BackboneMLP first, in this branch or later?tile_matmul for 16-bit floats. I did not measure it. Do you want
that measured against PyTorch fp16?notes/warp-inference/warp-inference.md