mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-04 07:18:50 +00:00
Made by tools/layout/move_0216.py (the commit before this one) on db8e0be9c, the final code head of 0.2.16:
- 75 git mv (renames, so `git log --follow` and blame keep working; packaging/acceptance_matrix.md shows as delete + add because its links
changed too) and 3 removals: SETUP.bat, UPDATE.bat and update.sh (setup.py --update pulls the code now);
- 1,425 path edits in 307 files: root-relative paths in CI, Docker, .gitignore and the release scripts; Markdown links; Python and
Node joins from a root that moved with its folder; explicit edits for code that computes a root or names a moved path; tables of
repository paths inside tests.
engine/ holds what CMake builds (src, include, cmake, metal, sycl, spark, third_party, the C++ tests and benches). app/ is the desktop
app and its host (was apps/). terminal/ is the Terminal in the layout of the installed one (strata.py, setup.py, strata_cli,
strata_control, serve, bin, data, ref, crates, the Python tools and tests). docs/ has the documentation, docs/lang/ the translated
READMEs, docs/history and docs/bench-results. tools/ has the repository's own checks, packaging, docker, research and nix.
tests/core/test_tqp_ref.py is a pytest file and stays with the Python tests (terminal/tests/core/).
AGENTS.md, README.md, LICENSE, setup.sh and START-HERE.bat stay at the root.
No behaviour change: the same command lines, the same sources. For this head a replay of the script gave the same numbers and the path
scan (tools/layout/checks/path_scan.py) reports no hit; the suites and the builds run on this commit next.
70 lines
5.7 KiB
C++
70 lines
5.7 KiB
C++
// stream_floor_default (include/strata/prefill/stream_floor_rule.hpp): the chunk size from which a prompt chunk takes the long-prompt path.
|
|
// Only the measured class (Windows gfx1151) with a layer set that is fused-only on every layer AND without the staged fused entry leaves the 1,024 default. No GPU, no model.
|
|
#include <cstdio>
|
|
|
|
#include "strata/prefill/stream_floor_rule.hpp"
|
|
|
|
using strata::prefill::kFusedOnlyFloor;
|
|
using strata::prefill::kStreamFloorDefault;
|
|
using strata::prefill::kTrellisCudaFloor;
|
|
using strata::prefill::stream_floor_default;
|
|
|
|
static int failed = 0;
|
|
#define CHECK(x) do { if (!(x)) { std::fprintf(stderr, "FAIL %s:%d: %s\n", __FILE__, __LINE__, #x); ++failed; } } while (0)
|
|
|
|
int main() {
|
|
static_assert(kStreamFloorDefault == 1024, "the default floor is the discrete cards' measured 1,024");
|
|
static_assert(kFusedOnlyFloor >= 1 && kFusedOnlyFloor < kStreamFloorDefault, "the fused-only floor is below the default");
|
|
// the staged fused entry off (STRATA_PF_STAGED_FO=0, or its prerequisites missing): step one's rule
|
|
CHECK(stream_floor_default(true, true, false) == kFusedOnlyFloor); // Windows gfx1151, every layer fused-only
|
|
CHECK(stream_floor_default(true, false, false) == kStreamFloorDefault); // a layer on MMQ or the FP16 path: unchanged
|
|
CHECK(stream_floor_default(false, true, false) == kStreamFloorDefault); // another card class (not measured): unchanged
|
|
CHECK(stream_floor_default(false, false, false) == kStreamFloorDefault);
|
|
// the entry on: pieces below 1,024 tokens take it, the long path from 1,024 up, on every class
|
|
CHECK(stream_floor_default(true, true, true) == kStreamFloorDefault);
|
|
CHECK(stream_floor_default(true, false, true) == kStreamFloorDefault);
|
|
CHECK(stream_floor_default(false, true, true) == kStreamFloorDefault); // STRATA_PF_STAGED_FO=1 on another class: the floor stays
|
|
CHECK(stream_floor_default(false, false, true) == kStreamFloorDefault);
|
|
// a build without MMQ with a non-native pack on the fused kernels (the Q2_0 pack): no staged entry or int8 path reads its layout, so the floor is 64 on every class, whatever the other flags
|
|
CHECK(stream_floor_default(false, false, false, true) == kFusedOnlyFloor);
|
|
CHECK(stream_floor_default(true, true, true, true) == kFusedOnlyFloor);
|
|
CHECK(stream_floor_default(false, true, true, true) == kFusedOnlyFloor);
|
|
// a build with MMQ, or a pack that is not plain-and-fused, passes false: the rows above are unchanged
|
|
CHECK(stream_floor_default(false, false, false, false) == kStreamFloorDefault);
|
|
CHECK(stream_floor_default(true, true, true, false) == kStreamFloorDefault);
|
|
// a build without MMQ on a gfx12 card with a native pack of trellis pairs on the fused kernels (Gyro-S on the R9700): the floor is 64 whatever the staged entry and the class say
|
|
CHECK(stream_floor_default(false, false, true, false, true) == kFusedOnlyFloor);
|
|
CHECK(stream_floor_default(false, false, false, false, true) == kFusedOnlyFloor);
|
|
CHECK(stream_floor_default(true, true, true, false, true) == kFusedOnlyFloor);
|
|
// a build without MMQ on a CUDA card on which the fused trellis kernels run (Gyro-S on an RTX A6000, sm_86 with 84 SMs): the floor is kTrellisCudaFloor whatever the class and the staged entry say
|
|
CHECK(stream_floor_default(false, false, false, false, false, true) == kTrellisCudaFloor);
|
|
CHECK(stream_floor_default(false, false, true, false, false, true) == kTrellisCudaFloor);
|
|
CHECK(stream_floor_default(true, true, true, false, false, true) == kTrellisCudaFloor);
|
|
CHECK(kTrellisCudaFloor >= 1 && kTrellisCudaFloor <= kStreamFloorDefault);
|
|
// the gfx12 rows stay as gated: the CUDA flag adds nothing to them (the two flags are never both true in one build)
|
|
CHECK(stream_floor_default(false, false, false, false, true, false) == kFusedOnlyFloor);
|
|
CHECK(stream_floor_default(false, false, false, false, true, true) == kFusedOnlyFloor);
|
|
// no CUDA flag (a build with MMQ, a card whose trellis kernels are off, another format set): every row above stands
|
|
CHECK(stream_floor_default(false, false, true, false, false, false) == kStreamFloorDefault);
|
|
CHECK(stream_floor_default(true, false, false, false, false, false) == kStreamFloorDefault);
|
|
// without the flag (a build with MMQ, another card, another format set) the rows above stand
|
|
CHECK(stream_floor_default(false, false, true, false, false) == kStreamFloorDefault);
|
|
CHECK(stream_floor_default(false, true, true, false, false) == kStreamFloorDefault);
|
|
// Windows gfx1151, an all-trellis set on the fused kernels (STRATA_PF_TQ_G1151 on, a build without MMQ): the gfx12 floor, with the staged entry on or off
|
|
CHECK(stream_floor_default(true, true, true, false, false, false, true) == kFusedOnlyFloor);
|
|
CHECK(stream_floor_default(true, true, false, false, false, false, true) == kFusedOnlyFloor);
|
|
// the same class and set with the flag false (switch off, Linux, a build with MMQ, another format set): the rows above stand
|
|
CHECK(stream_floor_default(true, true, true, false, false, false, false) == kStreamFloorDefault);
|
|
CHECK(stream_floor_default(true, false, false, false, false, false, false) == kStreamFloorDefault);
|
|
CHECK(stream_floor_default(false, false, false, false, false, false, false) == kStreamFloorDefault);
|
|
// the gfx12 and CUDA rows are not changed by the new flag's default
|
|
CHECK(stream_floor_default(false, false, false, false, true, false, false) == kFusedOnlyFloor);
|
|
CHECK(stream_floor_default(false, false, false, false, false, true, false) == kTrellisCudaFloor);
|
|
if (failed) {
|
|
std::fprintf(stderr, "stream_floor_rule_test: %d check(s) failed\n", failed);
|
|
return 1;
|
|
}
|
|
std::printf("stream_floor_rule_test: OK\n");
|
|
return 0;
|
|
}
|