leonida-shader: time group packing on the card (SHADER-PACK-TIMING); GPU tests prefer the high-performance adapter #2620

Merged
leonida/mandy
Param-2811 merged 1 commit from test/group-pack-timing into main 2026-11-30 15:57:09 +00:00

Pull request successfully merged and closed

Param-2811 commented 2026-11-29 18:09:29 +00:00

Claimed in the coordination issue as: SHADER-PACK-TIMING (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7260250260)

What and why

  • Host::new picks the high-performance adapter first (EnumAdapterByGpuPreference), then falls back to the default adapter as before. On a laptop with both an integrated GPU and a card, the default adapter is the integrated one, so the GPU tests ran there.
  • TIME_REPEATS, test-only: Host::dispatch runs the dispatch n times between two GPU timestamps, with a UAV barrier after each, and stores the microseconds per dispatch.
  • pack_tests::packing_times, ignored by default: the pack tests' 32-thread console program, run unpacked and packed ×2, ×4 and ×8 over 1,024, 8,192 and 57,600 groups. Every run's stores are checked against what the console would store.

Run it with: cargo test -p leonida-shader --features host --lib packing_times -- --ignored --nocapture

This does not turn packing on. In #1608, djrolfes's in-game A/B on an RTX 3070 Ti (Wine, VKD3D-Proton) got slower with LEONIDA_GROUP_PACK=4: GPU wait went from 8.7–14.5 ms to 25–52 ms. The program timed here is the best case (16 VGPRs, almost no arithmetic). The test is a way to check a packing rule on a card before a game run, for example packing only the programs under some VGPR count.

Tested

RTX 4060 Laptop GPU (8 GB, Ada), driver 621.01, Windows 11 build 26300. Four runs, the least of three per point, in µs per dispatch:

shape groups unpacked packed ×4 gain
32×1×1 1,024 1.9–2.7 1.5–2.2 1.2×
32×1×1 8,192 9.7–11.9 5.4–8.1 1.5–1.8×
32×1×1 57,600 119–143 119–122 1.0–1.2×
8×4×1 8,192 9.2–9.9 5.2–5.5 1.8×
8×4×1 57,600 119–125 119–126 1.0×
  • Packed ×4 was never slower than unpacked. Packed ×8 is worse than ×4 for 32×1×1.
  • At 57,600 groups the program writes 29.5 MB in about 120 µs, about 240 GB/s, which is the card's memory bandwidth. That point measures memory, not launch.
  • cargo test -p leonida-shader --features host --lib: 365 passed, 0 failed, 5 ignored, on that card.
  • The changed lines add nothing to rustfmt --check. scripts/check_no_game_data.py passes on both files.
  • No game run.

GPUs tested: NVIDIA GeForce RTX 4060 Laptop GPU, driver 621.01, Windows 11 (build 26300)

AI-assisted: yes (Claude)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator rule)
Claimed in the coordination issue as: SHADER-PACK-TIMING (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7260250260) ### What and why - **`Host::new` picks the high-performance adapter first** (`EnumAdapterByGpuPreference`), then falls back to the default adapter as before. On a laptop with both an integrated GPU and a card, the default adapter is the integrated one, so the GPU tests ran there. - **`TIME_REPEATS`, test-only:** `Host::dispatch` runs the dispatch n times between two GPU timestamps, with a UAV barrier after each, and stores the microseconds per dispatch. - **`pack_tests::packing_times`, ignored by default:** the pack tests' 32-thread console program, run unpacked and packed ×2, ×4 and ×8 over 1,024, 8,192 and 57,600 groups. Every run's stores are checked against what the console would store. Run it with: `cargo test -p leonida-shader --features host --lib packing_times -- --ignored --nocapture` This does **not** turn packing on. In #1608, djrolfes's in-game A/B on an RTX 3070 Ti (Wine, VKD3D-Proton) got slower with `LEONIDA_GROUP_PACK=4`: GPU wait went from 8.7–14.5 ms to 25–52 ms. The program timed here is the best case (16 VGPRs, almost no arithmetic). The test is a way to check a packing rule on a card before a game run, for example packing only the programs under some VGPR count. ### Tested RTX 4060 Laptop GPU (8 GB, Ada), driver 621.01, Windows 11 build 26300. Four runs, the least of three per point, in µs per dispatch: | shape | groups | unpacked | packed ×4 | gain | |---|---|---|---|---| | 32×1×1 | 1,024 | 1.9–2.7 | 1.5–2.2 | 1.2× | | 32×1×1 | 8,192 | 9.7–11.9 | 5.4–8.1 | 1.5–1.8× | | 32×1×1 | 57,600 | 119–143 | 119–122 | 1.0–1.2× | | 8×4×1 | 8,192 | 9.2–9.9 | 5.2–5.5 | 1.8× | | 8×4×1 | 57,600 | 119–125 | 119–126 | 1.0× | - Packed ×4 was never slower than unpacked. Packed ×8 is worse than ×4 for 32×1×1. - At 57,600 groups the program writes 29.5 MB in about 120 µs, about 240 GB/s, which is the card's memory bandwidth. That point measures memory, not launch. - `cargo test -p leonida-shader --features host --lib`: 365 passed, 0 failed, 5 ignored, on that card. - The changed lines add nothing to `rustfmt --check`. `scripts/check_no_game_data.py` passes on both files. - No game run. GPUs tested: NVIDIA GeForce RTX 4060 Laptop GPU, driver 621.01, Windows 11 (build 26300) AI-assisted: yes (Claude) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator rule)
merzleckeier commented 2026-11-29 18:25:08 +00:00

Independent packing_times run on fe5a7a8a merged onto main 4755667f. CachyOS, Wine 11.22, VKD3D-Proton 71cae091, DXVK 3.1.1-97-ga78a467cadb22be-pcos, cross-built diag profile. With both adapters visible and no device-name filter, the benchmark selected the RTX 4070 SUPER. I then kept both ICDs loaded and selected each adapter by its DXVK name. Three runs per GPU, using the test’s minimum of three for each data point. Every synthetic output comparison passed.

GPU and shape Groups ×2 speedup, three runs ×4 speedup, three runs
RTX 4070 SUPER / 620.73.04, 32×1×1 8,192 1.29, 1.28, 1.29 1.25, 1.24, 1.25
RTX 4070 SUPER, 8×4×1 8,192 1.32, 1.31, 1.32 1.30, 1.30, 1.30
Radeon 610M / RADV Mesa 26.3.1, 32×1×1 8,192 0.99, 0.98, 0.99 0.99, 0.98, 0.99
Radeon 610M, 8×4×1 8,192 0.99, 0.99, 0.99 0.99, 0.99, 0.99

At 1,024 groups, ×4 was consistently slower for 32×1×1 on the RTX (0.95, 0.94, 0.94) and both shapes on Radeon (0.91–0.92). At 57,600 groups, ×4 was near parity across both GPUs and shapes (0.97–1.04). These timings cover the synthetic dispatch benchmark only.

The focused regression run (emit::pack_tests::) passed all nine regular tests on both revisions. packing_times is ignored by default. The full base suite reached the time limit and I ended the full PR run to run the matched subset.

AI-assisted with OpenAI Codex.

Independent `packing_times` run on `fe5a7a8a` merged onto `main` `4755667f`. CachyOS, Wine 11.22, VKD3D-Proton `71cae091`, DXVK `3.1.1-97-ga78a467cadb22be-pcos`, cross-built `diag` profile. With both adapters visible and no device-name filter, the benchmark selected the RTX 4070 SUPER. I then kept both ICDs loaded and selected each adapter by its DXVK name. Three runs per GPU, using the test’s minimum of three for each data point. Every synthetic output comparison passed. | GPU and shape | Groups | ×2 speedup, three runs | ×4 speedup, three runs | | --- | ---: | --- | --- | | RTX 4070 SUPER / 620.73.04, 32×1×1 | 8,192 | 1.29, 1.28, 1.29 | 1.25, 1.24, 1.25 | | RTX 4070 SUPER, 8×4×1 | 8,192 | 1.32, 1.31, 1.32 | 1.30, 1.30, 1.30 | | Radeon 610M / RADV Mesa 26.3.1, 32×1×1 | 8,192 | 0.99, 0.98, 0.99 | 0.99, 0.98, 0.99 | | Radeon 610M, 8×4×1 | 8,192 | 0.99, 0.99, 0.99 | 0.99, 0.99, 0.99 | At 1,024 groups, ×4 was consistently slower for 32×1×1 on the RTX (0.95, 0.94, 0.94) and both shapes on Radeon (0.91–0.92). At 57,600 groups, ×4 was near parity across both GPUs and shapes (0.97–1.04). These timings cover the synthetic dispatch benchmark only. The focused regression run (`emit::pack_tests::`) passed all nine regular tests on both revisions. `packing_times` is ignored by default. The full base suite reached the time limit and I ended the full PR run to run the matched subset. AI-assisted with OpenAI Codex.
bobcatchris commented 2026-11-29 18:28:57 +00:00

Independent native Windows 11 + AMD Radeon RX 7900 XTX (gfx1100, driver 32.0.32029.2010, Ryzen 7 7800X3D with integrated Radeon graphics also present, Windows 11 10.0.26200) check of fe5a7a8af merged cleanly onto main 4755667f5 (no game files):

  • cargo test -p leonida-shader --lib emit::pack_tests -- --nocapture -> 9 passed; 0 failed; 1 ignored (2.71 s).
  • cargo test -p leonida-shader --lib emit::pack_tests::packing_times -- --ignored --nocapture -> 1 passed; 0 failed (1.36 s); high-performance adapter selection cleanly picked the discrete AMD Radeon RX 7900 XTX over the integrated GPU:
timed on AMD Radeon RX 7900 XTX
[32, 1, 1] x   1024 groups, us a dispatch:  k0     1.4 (1.00x)  k2     1.3 (1.04x)  k4     1.3 (1.03x)  k8     1.4 (1.01x)
[32, 1, 1] x   8192 groups, us a dispatch:  k0     5.8 (1.00x)  k2     3.3 (1.74x)  k4     3.3 (1.73x)  k8     3.4 (1.72x)
[32, 1, 1] x  57600 groups, us a dispatch:  k0    36.3 (1.00x)  k2    29.3 (1.24x)  k4    29.9 (1.22x)  k8    28.0 (1.30x)
[8, 4, 1] x   1024 groups, us a dispatch:  k0     1.4 (1.00x)  k2     1.4 (1.04x)  k4     1.4 (1.04x)  k8     1.4 (1.01x)
[8, 4, 1] x   8192 groups, us a dispatch:  k0     5.8 (1.00x)  k2     3.4 (1.69x)  k4     3.4 (1.68x)  k8     3.5 (1.68x)
[8, 4, 1] x  57600 groups, us a dispatch:  k0    36.4 (1.00x)  k2    29.3 (1.24x)  k4    28.7 (1.27x)  k8    28.1 (1.29x)
  • Zero new compiler warnings in emit/host.rs or emit/pack_tests.rs.

AI-assisted: Antigravity (Gemini 4 Neon).

Independent native Windows 11 + AMD Radeon RX 7900 XTX (`gfx1100`, driver `32.0.32029.2010`, Ryzen 7 7800X3D with integrated Radeon graphics also present, Windows 11 `10.0.26200`) check of `fe5a7a8af` merged cleanly onto `main` `4755667f5` (no game files): - `cargo test -p leonida-shader --lib emit::pack_tests -- --nocapture` -> `9 passed; 0 failed; 1 ignored` (2.71 s). - `cargo test -p leonida-shader --lib emit::pack_tests::packing_times -- --ignored --nocapture` -> `1 passed; 0 failed` (1.36 s); high-performance adapter selection cleanly picked the discrete `AMD Radeon RX 7900 XTX` over the integrated GPU: ```text timed on AMD Radeon RX 7900 XTX [32, 1, 1] x 1024 groups, us a dispatch: k0 1.4 (1.00x) k2 1.3 (1.04x) k4 1.3 (1.03x) k8 1.4 (1.01x) [32, 1, 1] x 8192 groups, us a dispatch: k0 5.8 (1.00x) k2 3.3 (1.74x) k4 3.3 (1.73x) k8 3.4 (1.72x) [32, 1, 1] x 57600 groups, us a dispatch: k0 36.3 (1.00x) k2 29.3 (1.24x) k4 29.9 (1.22x) k8 28.0 (1.30x) [8, 4, 1] x 1024 groups, us a dispatch: k0 1.4 (1.00x) k2 1.4 (1.04x) k4 1.4 (1.04x) k8 1.4 (1.01x) [8, 4, 1] x 8192 groups, us a dispatch: k0 5.8 (1.00x) k2 3.4 (1.69x) k4 3.4 (1.68x) k8 3.5 (1.68x) [8, 4, 1] x 57600 groups, us a dispatch: k0 36.4 (1.00x) k2 29.3 (1.24x) k4 28.7 (1.27x) k8 28.1 (1.29x) ``` - Zero new compiler warnings in `emit/host.rs` or `emit/pack_tests.rs`. AI-assisted: Antigravity (Gemini 4 Neon).
ecox982745 commented 2026-11-29 20:34:26 +00:00

Native D3D12 verification on RTX 4090 (NVIDIA 616.64, Windows 11 build 26300, MSVC, Rust 1.98.1). I tested fe5a7a8af merged cleanly with edf0ff5d0 (tree 510ad978). With the Windows SDK 26100 x64 dxil.dll (product version 1.9.2602.17), the pack subset passed 9 of 9 regular tests, and four explicit packing_times runs passed every synthetic output comparison. The benchmark reported the RTX 4090 as the selected adapter.

Thread-group shape Groups Unpacked (µs) Packed ×4 (µs) Speedup across four runs
32×1×1 1,024 1.7 1.4 1.17×
32×1×1 8,192 5.2 3.0 1.73–1.74×
32×1×1 57,600 29.4–29.7 13.7 2.15–2.16×
8×4×1 1,024 1.7 1.5 1.11–1.12×
8×4×1 8,192 5.2 3.1 1.66×
8×4×1 57,600 29.7 13.9 2.14×

×8 led at 1,024 groups and was slower than ×4 at 8,192 and 57,600 groups for both shapes. These are synthetic dispatch timings.

One Windows setup finding. The automatically selected SDK 19041 x64 validator (10.0.19041.5609) gave 0xc0000005 before a timing result. The CPU-only a_packed_program_names_its_grid_and_the_group_size_the_console_has also exited with 0xc0000005 with that DLL on both unmodified edf0ff5d0 and the merged tree. Both binaries passed that test with SDK 26100 selected via LEONIDA_DXIL. This isolates the observed failure to the validator selection, independent of GPU execution.

AI-assisted with OpenAI Codex (GPT-6.2 Sol).

Native D3D12 verification on RTX 4090 (NVIDIA 616.64, Windows 11 build 26300, MSVC, Rust 1.98.1). I tested `fe5a7a8af` merged cleanly with `edf0ff5d0` (tree `510ad978`). With the Windows SDK 26100 x64 `dxil.dll` (product version 1.9.2602.17), the pack subset passed 9 of 9 regular tests, and four explicit `packing_times` runs passed every synthetic output comparison. The benchmark reported the RTX 4090 as the selected adapter. | Thread-group shape | Groups | Unpacked (µs) | Packed ×4 (µs) | Speedup across four runs | | --- | ---: | ---: | ---: | ---: | | 32×1×1 | 1,024 | 1.7 | 1.4 | 1.17× | | 32×1×1 | 8,192 | 5.2 | 3.0 | 1.73–1.74× | | 32×1×1 | 57,600 | 29.4–29.7 | 13.7 | 2.15–2.16× | | 8×4×1 | 1,024 | 1.7 | 1.5 | 1.11–1.12× | | 8×4×1 | 8,192 | 5.2 | 3.1 | 1.66× | | 8×4×1 | 57,600 | 29.7 | 13.9 | 2.14× | ×8 led at 1,024 groups and was slower than ×4 at 8,192 and 57,600 groups for both shapes. These are synthetic dispatch timings. One Windows setup finding. The automatically selected SDK 19041 x64 validator (10.0.19041.5609) gave `0xc0000005` before a timing result. The CPU-only `a_packed_program_names_its_grid_and_the_group_size_the_console_has` also exited with `0xc0000005` with that DLL on both unmodified `edf0ff5d0` and the merged tree. Both binaries passed that test with SDK 26100 selected via `LEONIDA_DXIL`. This isolates the observed failure to the validator selection, independent of GPU execution. AI-assisted with OpenAI Codex (GPT-6.2 Sol).
ammonium231 commented 2026-11-29 21:24:19 +00:00

RTX 3090 / 621.40, fe5a7a8af merged onto main edf0ff5d0: pack_tests pass, packing_times runs on the 3090 (4 runs). Steady gain at 8192 groups: k4 1.92–1.94x for [32,1,1], 1.65–1.87x for [8,4,1]. At 57600 it's noisy run to run ([32,1,1] k4 0.56–1.07x), with no consistent gain or loss.

RTX 3090 / 621.40, fe5a7a8af merged onto main edf0ff5d0: pack_tests pass, packing_times runs on the 3090 (4 runs). Steady gain at 8192 groups: k4 1.92–1.94x for [32,1,1], 1.65–1.87x for [8,4,1]. At 57600 it's noisy run to run ([32,1,1] k4 0.56–1.07x), with no consistent gain or loss.
OreoFR commented 2026-11-29 21:43:11 +00:00

Partial check by OreoFR on macOS 27.2.1 (26B131), Apple M5, Rust 1.98.1 (d3d12/rust-toolchain.toml), main 060c47160 (merges cleanly; does not force a rebase of #2566 at eade9562c), PR head fe5a7a8af

  • Both changed files are Windows-only (emit/host.rs is cfg(all(windows, ...)), pack_tests.rs is cfg(all(test, windows)); the new packing_times test is also #[ignore]), so nothing this PR changes is compiled on macOS: leonida-shader 224 passed / 2 ignored on both main and merge.
  • Windows cross-check (lib + host, tests): 0 errors, no new warning; clippy identical to main.
  • Diff: EnumAdapterByGpuPreference falls back cleanly to None; TIME_REPEATS is cfg(test) only. No game data. Several positive native-hardware reports in the comments.

Verdict: not testable on macOS (no red possible here); Windows type-check clean.

AI-assisted: Claude Code

Partial check by OreoFR on macOS 27.2.1 (26B131), Apple M5, Rust 1.98.1 (d3d12/rust-toolchain.toml), main 060c47160 (merges cleanly; does not force a rebase of #2566 at eade9562c), PR head fe5a7a8af - Both changed files are Windows-only (`emit/host.rs` is `cfg(all(windows, ...))`, `pack_tests.rs` is `cfg(all(test, windows))`; the new `packing_times` test is also `#[ignore]`), so nothing this PR changes is compiled on macOS: leonida-shader 224 passed / 2 ignored on both main and merge. - Windows cross-check (lib + host, tests): 0 errors, no new warning; clippy identical to main. - Diff: `EnumAdapterByGpuPreference` falls back cleanly to `None`; `TIME_REPEATS` is `cfg(test)` only. No game data. Several positive native-hardware reports in the comments. **Verdict: not testable on macOS (no red possible here); Windows type-check clean.** AI-assisted: Claude Code
ammonium231 commented 2026-11-29 22:57:53 +00:00

20 more runs, same tree: medians at 57600 are [32,1,1] k2/k4/k8 1.07/1.07/1.11x. [8,4,1] 57600 is bimodal (~37–50 vs ~80–94 us) for k0 and packed alike, so the earlier 0.5x reads as a slow-mode sample, not packing.

20 more runs, same tree: medians at 57600 are [32,1,1] k2/k4/k8 1.07/1.07/1.11x. [8,4,1] 57600 is bimodal (~37–50 vs ~80–94 us) for k0 and packed alike, so the earlier 0.5x reads as a slow-mode sample, not packing.
OreoFR commented 2026-11-29 22:58:18 +00:00

Verified by OreoFR (Windows part; oreofr-mac covered leonida-shader on macOS, where all of this PR is compiled out)

PR head fe5a7a8af merged with git merge --no-ff onto main 060c47160, no conflict. Windows 11 Pro 10.0.26300, RTX 4070 Laptop 8 GB + Intel Arc integrated graphics (a laptop with two adapters, the case the adapter change is for), NVIDIA 621.40, Rust 1.98.1. The GPU is used.

  • cargo test -p leonida-shader --locked: 368 passed / 0 failed / 5 ignored (main 368/0/4; the +1 ignored is packing_times). All 9 regular pack_tests pass.
  • packing_times (--features host -- --ignored --nocapture): passes, every output comparison matches, timed on NVIDIA GeForce RTX 4070 Laptop GPU. At 8 192 groups, k2/k4 give 1.47 to 1.49x for [32,1,1] and 1.42x for [8,4,1]. At 57 600 groups the gain is 1.00 to 1.06x, and k8 is slower at 1 024 groups of [8,4,1] (0.78x).
  • Red: NO RED possible. The new test is #[ignore] and a benchmark. I also ran it with only the adapter hunk of emit/host.rs restored to main: it still ran on the RTX 4070 Laptop here (the default adapter of this machine is already the NVIDIA card), so this laptop does not show the difference the change is meant for.
  • #2566 (eade9562c) rebase needed after this: no (git merge-tree is clean).

Verdict: NO RED (green on Windows, benchmark runs on the discrete card).

This verification was AI-assisted (Claude Code, oreofr-agent).

**Verified by OreoFR** (Windows part; oreofr-mac covered leonida-shader on macOS, where all of this PR is compiled out) PR head `fe5a7a8af` merged with `git merge --no-ff` onto main `060c47160`, no conflict. Windows 11 Pro 10.0.26300, RTX 4070 Laptop 8 GB + Intel Arc integrated graphics (a laptop with two adapters, the case the adapter change is for), NVIDIA 621.40, Rust 1.98.1. The GPU is used. - `cargo test -p leonida-shader --locked`: **368 passed / 0 failed / 5 ignored** (main 368/0/4; the +1 ignored is `packing_times`). All 9 regular `pack_tests` pass. - `packing_times` (`--features host -- --ignored --nocapture`): passes, every output comparison matches, `timed on NVIDIA GeForce RTX 4070 Laptop GPU`. At 8 192 groups, k2/k4 give 1.47 to 1.49x for [32,1,1] and 1.42x for [8,4,1]. At 57 600 groups the gain is 1.00 to 1.06x, and k8 is slower at 1 024 groups of [8,4,1] (0.78x). - Red: **NO RED possible**. The new test is `#[ignore]` and a benchmark. I also ran it with only the adapter hunk of `emit/host.rs` restored to main: it still ran on the RTX 4070 Laptop here (the default adapter of this machine is already the NVIDIA card), so this laptop does not show the difference the change is meant for. - #2566 (`eade9562c`) rebase needed after this: **no** (`git merge-tree` is clean). Verdict: **NO RED** (green on Windows, benchmark runs on the discrete card). This verification was AI-assisted (Claude Code, oreofr-agent).
MoonEyes commented 2026-11-30 15:57:00 +00:00

Verified: PR head merges cleanly with main; 368 passed / 0 failed / 5 ignored for leonida-shader, with 9 pack-tests passing. Independent GPU checks passed on NVIDIA, AMD and Radeon hardware; synthetic benchmark reports are positive where applicable. No game data. AI-assisted review/verification.

Verified: PR head merges cleanly with main; 368 passed / 0 failed / 5 ignored for leonida-shader, with 9 pack-tests passing. Independent GPU checks passed on NVIDIA, AMD and Radeon hardware; synthetic benchmark reports are positive where applicable. No game data. AI-assisted review/verification.
Default0009 commented 2026-12-03 00:09:18 +00:00

Card: RTX 2070 Super 8 GB (Turing), Windows. packing_times run as cargo test -p leonida-shader --features host --lib packing_times -- --ignored --nocapture, on clean main (f3865cae8), debug test build, clocks not locked. Least of three runs, microseconds per dispatch, speed-up against unpacked:

shape groups unpacked µs ×2 ×4 ×8
32×1×1 1,024 2.2 1.08× 1.13× 1.07×
32×1×1 8,192 11.5 1.01× 1.01× 0.68×
32×1×1 57,600 193 1.01× 1.00× 1.04×
8×4×1 1,024 2.2 1.07× 1.07× 1.06×
8×4×1 8,192 26.1 2.27× 2.27× 0.95×
8×4×1 57,600 182 0.98× 1.14× 1.15×

On Turing the common 32×1×1 shape gains 1.0–1.13× (against 1.5–1.8× on the RTX 4060 Laptop in the PR), and ×8 is slower at 8,192 groups. The one large gain is 8×4×1 at 8,192 groups, where the unpacked time is unusually high. This is MEASURED once, on a 16-register program, so it is the best case. It says nothing about the heavy programs, and 554 programs use over 128 registers.

Card: RTX 2070 Super 8 GB (Turing), Windows. packing_times run as cargo test -p leonida-shader --features host --lib packing_times -- --ignored --nocapture, on clean main (f3865cae8), debug test build, clocks not locked. Least of three runs, microseconds per dispatch, speed-up against unpacked: | shape | groups | unpacked µs | ×2 | ×4 | ×8 | |--------|--------|-------------|-------|-------|-------| | 32×1×1 | 1,024 | 2.2 | 1.08× | 1.13× | 1.07× | | 32×1×1 | 8,192 | 11.5 | 1.01× | 1.01× | 0.68× | | 32×1×1 | 57,600 | 193 | 1.01× | 1.00× | 1.04× | | 8×4×1 | 1,024 | 2.2 | 1.07× | 1.07× | 1.06× | | 8×4×1 | 8,192 | 26.1 | 2.27× | 2.27× | 0.95× | | 8×4×1 | 57,600 | 182 | 0.98× | 1.14× | 1.15× | On Turing the common 32×1×1 shape gains 1.0–1.13× (against 1.5–1.8× on the RTX 4060 Laptop in the PR), and ×8 is slower at 8,192 groups. The one large gain is 8×4×1 at 8,192 groups, where the unpacked time is unusually high. This is MEASURED once, on a 16-register program, so it is the best case. It says nothing about the heavy programs, and 554 programs use over 128 registers.
Sign in to join this conversation.
No description provided.