mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-05 07:48:45 +00:00
setup: bare_auto_is_32768 follows the engine's rule for compute capability 7.0 too
The engine now gives a bare --prefill auto the 32768 ceiling on one Volta card (nv_chunk_card_ok(7, 0)), so setup must not print the "--prefill auto:32768 read prompts 21-35% faster" tip for a V100 config. arch "70" is now yes; "75" (Turing) and "6x" (Pascal) stay no. tools/test_setup_bench_tips pins both.
This commit is contained in:
1 parent
c7c78ed4f3
commit
3a1e3cc648
2 files changed
+14
-6
No files matched your search
@@ -8017,10 +8017,15 @@ def arg_after(args, flag):
|
||||
|
||||
|
||||
def bare_auto_is_32768(gpu, args, env) -> bool:
|
||||
"""Round 0212 (owner 11-03): the engine gives a bare `--prefill auto` a 32768-token ceiling on one NVIDIA card of compute capability 8.0 or up
|
||||
(generate.cpp, nv_chunk.hpp); STRATA_NV_CHUNK=0 or STRATA_DEFAULTS=026 (the config's env or this process's) keep 8192, and a layer split reads 8192-token chunks."""
|
||||
"""Round 0212 (owner 11-03): the engine gives a bare `--prefill auto` a 32768-token ceiling on one NVIDIA card of compute capability 8.0 or up, and on
|
||||
7.0 (Volta; include/strata/core/nv_chunk.hpp `nv_chunk_card_ok`, called from generate.cpp); Turing (7.5) and Pascal (6.x) keep 8192. STRATA_NV_CHUNK=0
|
||||
or STRATA_DEFAULTS=026 (the config's env or this process's) keep 8192, and a layer split reads 8192-token chunks. `gpu` is the one card the config
|
||||
runs on (the engine sees only the cards CUDA_VISIBLE_DEVICES names, so for a mixed PC the lowest of those decides, which is this card)."""
|
||||
arch = str((gpu or {}).get("arch", ""))
|
||||
if not arch.isdigit() or len(arch) < 2 or int(arch[:-1]) < 8:
|
||||
if not arch.isdigit() or len(arch) < 2:
|
||||
return False
|
||||
major, minor = int(arch[:-1]), int(arch[-1]) # "70" -> 7.0, "86" -> 8.6, "120" -> 12.0
|
||||
if not (major >= 8 or (major == 7 and minor == 0)):
|
||||
return False
|
||||
if any(a in (args or []) for a in ("--gpus", "--layer-split")):
|
||||
return False
|
||||
|
||||
@@ -46,17 +46,20 @@ class BenchTips(unittest.TestCase):
|
||||
self.assertEqual([t for t in tips(big, ram=96) if "auto:32768" in t], [])
|
||||
|
||||
def test_the_32768_tip_is_left_out_where_a_bare_auto_already_takes_it(self):
|
||||
# round 0212: one NVIDIA card of compute capability 8.0+ (arch "86", "120", "121") gets a 32768 ceiling from a bare auto
|
||||
# round 0212: one NVIDIA card of compute capability 8.0+ (arch "86", "120", "121") gets a 32768 ceiling from a bare auto; so does 7.0 (Volta, "70"),
|
||||
# the engine's own rule (nv_chunk_card_ok in include/strata/core/nv_chunk.hpp)
|
||||
tip = lambda **k: [t for t in tips(ram=128, **k) if "auto:32768" in t]
|
||||
for arch in ("86", "89", "120", "121"):
|
||||
for arch in ("70", "80", "86", "89", "90", "120", "121"):
|
||||
self.assertEqual(tip(gpu={"arch": arch}), [], arch)
|
||||
for arch in ("75", "70", "60", "gfx1201", ""): # older cards, AMD, unknown: the tip stays
|
||||
for arch in ("75", "60", "61", "62", "52", "gfx1201", ""): # Turing, Pascal, older cards, AMD, unknown: the tip stays
|
||||
self.assertTrue(tip(gpu={"arch": arch}), arch)
|
||||
self.assertTrue(tip()) # no GPU information: as before
|
||||
self.assertTrue(tip(gpu={"arch": "86"}, env={"STRATA_NV_CHUNK": "0"}))
|
||||
self.assertTrue(tip(gpu={"arch": "86"}, env={"STRATA_DEFAULTS": "026"}))
|
||||
self.assertTrue(tip(args=[*BASE, "--gpus", "0,1"], gpu={"arch": "86"})) # a layer split reads 8192-token chunks
|
||||
self.assertTrue(tip(args=[*BASE, "--layer-split", "auto"], gpu={"arch": "86"}))
|
||||
self.assertTrue(tip(gpu={"arch": "70"}, env={"STRATA_NV_CHUNK": "0"})) # Volta follows the same switches and the same layer-split rule
|
||||
self.assertTrue(tip(args=[*BASE, "--gpus", "0,1"], gpu={"arch": "70"}))
|
||||
|
||||
def test_resident_headroom_on_small_ram(self):
|
||||
res = [*BASE, "--resident-experts"]
|
||||
|
||||
Reference in new issue
Block a user