-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest_gdn_packed_reg_tile.cpp
More file actions
32 lines (29 loc) · 1.5 KB
/
Copy pathtest_gdn_packed_reg_tile.cpp
File metadata and controls
32 lines (29 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// vllm.cpp original (vt runtime, inventory deviation §9.1); no upstream mirror.
// CPU-tier contract for the env-flag plumbing that selects the register-resident
// packed-decode tiling (src/vt/cuda/gdn_packed_reg_tile.h): the
// VT_GDN_PACKED_REG_TILE flag predicate. The register-resident kernel itself is
// CUDA-only and lives in cuda_gdn.cu (GdnPackedDecodeRegTileKernel); its
// bit-exactness and the rollback-selects-legacy launch check are DGX-gated CUDA
// cases in tests/vt/test_ops_gdn.cpp. This suite pins the portable default-ON /
// '0'-off parse so the rollback contract is regression-covered on every
// platform, not just DGX.
#include <doctest/doctest.h>
#include "vt/cuda/gdn_packed_reg_tile.h"
using vt::cuda::GdnPackedRegTileFlagIsOn;
TEST_CASE(
"VT_GDN_PACKED_REG_TILE defaults OFF; only a '1'-leading value opts in") {
// Default (unset) is OFF: the legacy shared-memory kernel ships after the
// 2026-07-16 DGX proof failed (oracle boundary FAIL; c16 -12%).
CHECK_FALSE(GdnPackedRegTileFlagIsOn(nullptr));
// Non-'1'-leading values stay OFF.
CHECK_FALSE(GdnPackedRegTileFlagIsOn(""));
CHECK_FALSE(GdnPackedRegTileFlagIsOn("on"));
CHECK_FALSE(GdnPackedRegTileFlagIsOn("true"));
CHECK_FALSE(GdnPackedRegTileFlagIsOn("2"));
CHECK_FALSE(GdnPackedRegTileFlagIsOn("0"));
CHECK_FALSE(GdnPackedRegTileFlagIsOn(" 1"));
// Experimental opt-in: FIRST character '1'.
CHECK(GdnPackedRegTileFlagIsOn("1"));
CHECK(GdnPackedRegTileFlagIsOn("10"));
CHECK(GdnPackedRegTileFlagIsOn("1abc"));
}