Skip to content

Commit 9185cd9

Browse files
Correct docs and comments after adversarial review
- State that PBE fails only when input sizes vary between calls (TPSS fails on its second call), so the repeated-evaluation test depends on the 4-atom UltraFineGrid system producing differently sized model batches. - Stop listing LDA as a model observed to fail; it was never observed to. - Note that the guard made PBE about 3x slower per model evaluation in a standalone measurement. - Document that the guard is ineffective once an unguarded call has cached the optimized plan, so all model evaluation must stay inside the guarded lambdas. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent cfdac3c commit 9185cd9

5 files changed

Lines changed: 25 additions & 15 deletions

File tree

‎SkalaXC/README.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,11 @@ LDA/PBE/TPSS energies, potentials, and gradients are covered, including
8484
repeated evaluation, on an A100 (sm_80). The traditional TorchScript archives
8585
can fail after their first evaluations with "too many resources requested for
8686
launch" when PyTorch installs a fused backward kernel (observed for PBE and TPSS
87-
on sm_80 and for TPSS on sm_120; see microsoft/skala#132). SkalaXC therefore
88-
runs these purely local models with TorchScript graph optimization disabled on
89-
the calling thread; the neural model is unaffected. This has not been verified
90-
on sm_120.
87+
on sm_80 and for TPSS on sm_120; LDA was not observed to fail; see
88+
microsoft/skala#132). SkalaXC therefore runs these purely local models with
89+
TorchScript graph optimization disabled on the calling thread; the neural model
90+
is unaffected. This made PBE about 3x slower per model evaluation in a
91+
standalone measurement. It has not been verified on sm_120.
9192
Task tiles respect both the selected device's grid Y/Z limits and GauXC's
9293
independent memory limit.
9394

‎SkalaXC/src/device/skala_device_driver.cxx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ bool is_local_model(const SkalaModel& model) {
138138
* for launch" (microsoft/skala#132). Unoptimized execution avoids it. The flag
139139
* is thread-local and restored on scope exit, and the neural model, which does
140140
* not exhibit the failure, keeps its optimized execution.
141+
*
142+
* The execution plan is chosen on the first forward call and then cached, so
143+
* the guard has no effect once any unguarded call has run on the same module.
144+
* All model evaluation must therefore stay inside the guarded evaluation
145+
* lambdas; do not add a warm-up or diagnostic call outside them.
141146
*/
142147
class LocalModelOptimizerGuard {
143148
public:

‎SkalaXC/tests/README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ the exported CMake package. ABI tests reject leaked private dependency symbols.
1111
CUDA tests, when enabled, cover device parity, batching, streams, idle ranks,
1212
and subcommunicators. MPI tests require actual multi-rank execution.
1313
The CUDA repeated-evaluation test guards against the TorchScript fused-kernel
14-
launch failure for the traditional models (microsoft/skala#132); it needs a
15-
multi-atom system and several calls to fail without the fix.
14+
launch failure for the traditional models (microsoft/skala#132). TPSS fails on
15+
its second call; PBE fails only when input sizes vary between calls, which the
16+
4-atom UltraFineGrid system produces through differently sized model batches.
1617

1718
Run the narrowest Catch2 tag first, then CTest:
1819

‎SkalaXC/tests/skala_device_test.cxx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,10 @@ TEST_CASE("Skala CUDA traditional models survive repeated evaluation",
357357
"[skala][cuda][device-repeated]") {
358358
// TorchScript installs a fused backward kernel after its profiling runs; for
359359
// the traditional archives it can exceed the device's launch resources
360-
// (microsoft/skala#132). Without the optimizer guard, PBE and TPSS fail on a
361-
// multi-atom system within the first one or two evaluations.
360+
// (microsoft/skala#132). Without the optimizer guard, TPSS fails on its
361+
// second call and PBE fails when input sizes vary between calls. Here the
362+
// 4-atom UltraFineGrid system yields differently sized model batches, so
363+
// PBE depends on that grid; keep it multi-batch if the grid changes.
362364
SkalaXC::Molecule molecule;
363365
for (int atom = 0; atom < 4; ++atom)
364366
molecule.emplace_back(SkalaXC::AtomicNumber(1), 0.0, 0.0, 1.4 * atom);

‎website/skalaxc/installation.rst‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ Limitations
4343
The validated production backend is host UKS evaluation of energy, potentials,
4444
and gradients. RKS is not implemented. CUDA is experimental and disabled by
4545
default; enabling it requires a compatible CUDA compiler, GPU-enabled
46-
LibTorch, and validation on the target GPU. The archived LDA, PBE and TPSS
47-
models can fail after their first evaluations with "too many resources requested
48-
for launch" because PyTorch installs a fused backward kernel (observed for PBE
49-
and TPSS on sm_80 and for TPSS on sm_120, see microsoft/skala#132). SkalaXC runs
50-
these models with TorchScript graph optimization disabled; the neural model is
51-
unaffected. Repeated LDA, PBE and TPSS CUDA evaluation is tested on an A100
52-
(sm_80) but not yet on sm_120.
46+
LibTorch, and validation on the target GPU. The archived PBE and TPSS models
47+
can fail after their first evaluations with "too many resources requested for
48+
launch" because PyTorch installs a fused backward kernel (observed for PBE and
49+
TPSS on sm_80 and for TPSS on sm_120, see microsoft/skala#132; LDA was not
50+
observed to fail). SkalaXC runs LDA, PBE and TPSS with TorchScript graph
51+
optimization disabled; the neural model is unaffected. This made PBE about 3x
52+
slower per model evaluation in a standalone measurement. Repeated LDA, PBE and
53+
TPSS CUDA evaluation is tested on an A100 (sm_80) but not yet on sm_120.

0 commit comments

Comments
 (0)