mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4662
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/3511
Author: @chaog992
Created: 10/20/2026
Status: ❌ Closed
Base:
main← Head:gyro-tq-tests📝 Commits (2)
06a3070tools: check_isa_guard knows the trellis kernel units (#3409; isa_guard_check failed out of the box)52a3450tests: tq_cpu_parity and native_hadamard_test skip on an upstream ggml instead of failing (#3358, #3409)📊 Changes
5 files changed (+63 additions, -9 deletions)
View changed files
📝
CMakeLists.txt(+6 -4)📝
src/kernels/cpu/native_hadamard_test.cpp(+8 -2)📝
src/kernels/cpu/tq_cpu_parity.cpp(+1 -1)📝
tools/check_isa_guard.py(+4 -2)📝
tools/test_check_isa_guard.py(+44 -0)📄 Description
Problem and result
A test build on the default (upstream, pinned) ggml shows four ctest failures out of the box since the Gyro
port:
isa_guard_checkflagstq_rows_avx512in the newtq_avx512.cppunit ("outside the wide-ISA translationunits" here and in #3358; "in an unlisted public function" in #3409's g++ 14.4 build), and
tq_cpu_parity,tq_cpu_parity_avx2andnative_hadamard_testexit 1 because this ggml has notrellis types. Seen on Linux x86-64 CPU builds (here), CUDA (#3409) and HIP (#3358). Result: the guard passes
again on Release and RelWithDebInfo builds, the TQ tests report as Skipped where nothing more can be checked,
and the checks that need no trellis type still run - the suite here goes from 4 failures to 0.
Related discussion
Fixes #3409 (the guard entries are the three it proposes, and the skip its related note asks for; this adds
the unit test and the variant receipts). The same failures on HIP are in #3358's log. Two commits, one problem
(the out-of-the-box failures), separable if you prefer to take either alone.
Approach
Commit 1 (
tools/):WIDE_OBJECTS+=tq_avx512.cpp,WIDE_PUBLIC+=tq_rows_avx512(wide on purpose,the nvfp4 shape -
cb88d3d2,82fa92ff:tq_cpu.cpppicksTqIsa::avx512only behindcpu_avx512_ok(), andtq_rows()/tq_gu_rows()abort if asked for an ISA the CPU lacks - unconfirmed static analysis; #3409'sAVX-only Xeon saw no illegal instruction).
INIT_FREE_OBJECTS+=tq_avx2.cpp: no effect today (it has nostatic initialiser), but a #2324-shaped constructor table would be flagged on ELF builds instead of missed.
Three test cases added: the ELF and a synthetic MSVC-style name of
tq_rows_avx512are allowed (judge()reads the leading name); a weak copy of a
tq_states.hpphelper in the wide unit stays a violation; andrun_elfflags a mocked AVX-class static initialiser intq_avx2.cpp.o(#2324) - the receipt that theINIT_FREE_OBJECTSline is load-bearing. CRLF line endings of the guard file are preserved byte for byte.Commit 2 (test sources + their ctest entries): return 77 where nothing more can be checked, with
SKIP_RETURN_CODE 77- the project's own pattern (3d6793a4, #1475).native_hadamard_testruns its Q8_0 foldcheck (llama.cpp graph vs the folded CPU path; no trellis type needed) before the probe, so a broken FWHT or
fold still fails on any ggml; its
--packmode refuses on an upstream ggml instead of callingggml_row_size()with the fork's type ids 144-146, past the end of upstream's 43-entry type table (a minimalprogram making that call against the pinned ggml-base dies with SIGSEGV). On the agentionai fork nothing
changes: the probe fires only when
GGML_TYPE_COUNT <= 146.Validation
Tested:
06a30708+52a34500on main9ae93f7b(v0.2.1.1), WSL2 Ubuntu 24.04, gcc 13.3, Python 3.12, upstreamggml at the pin (3cf03257); both commits also merge cleanly onto current main.
Passed:
cmake -DCMAKE_BUILD_TYPE=Release -DSTRATA_BUILD_TESTS=ON -DSTRATA_GGML_DIR=<llama.cpp@pin>thenctest -j8: 49 tests, 0 failed, 45 passed, 4 Skipped (expert_multi_test + the three TQ skips); at theunpatched base the same build fails 4. The guard, its test, the two TQ test sources and the trellis units
are unchanged from v0.2.0-beta (
3d1fb480, where #3409 and #3358 were reported) to v0.2.1.1, and theunpatched guard still reports the tq_rows_avx512 violation on this build's archive.
python -m unittest tools.test_check_isa_guard: 12 tests OK. Against the unpatched guard, two of the newcases fail (the allowlist case and the mocked-initialiser case); with only the
INIT_FREE_OBJECTSlineremoved, the initialiser case alone fails. The patched guard on the base build's real
libstrata_kernels_cpu.a: "488 functions, 70 hold wide-ISA instructions, 0 not allowed".WIDE_PUBLICentry the guard still fails ("unlisted public function"), soboth entries are needed; a mutant
tq_avx2.cppwith a constructor-built table is flagged ("staticinitialiser ... #2324") only with the
INIT_FREE_OBJECTSentry.native_hadamard_teston this ggml: FWHT ok, Q8_0 fold ok ("strata vs llama.cpp graph 0.00e+00"), trellisskipped, rc 77; forced-broken FWHT and fold each exit 1.
--pack x --gguf y: refuses, rc 1.-DSTRATA_BUILD_TESTS=ON,building only the CPU test targets (the change touches no GPU code): in both,
ctest -R 'tq_cpu_parity|native_hadamard_test|isa_guard_check'gives isa_guard_check Passed and the threeTQ tests Skipped, 0 failed - the configurations #3409 (CUDA) and #3358 (HIP) report.
Failed: none observed.
Not run: Windows/MSVC (the guard's PE path uses the same judge(); the entries should carry over); the
agentionai fork configuration (guarded by the probe; not present here); AVX-512 hardware; an AVX-only CPU
such as #3409's (STRATA_ISA_FLOOR=avx), where native_hadamard_test's Q8_0 fold check now runs for the first
time on an upstream ggml; full CUDA/HIP backend builds (no GPU source is touched); SYCL (its build registers
none of these tests).
Limits
isa_guard_checkon a weak copy of atq_states.hpphelper(
tq_half_to_float) in the wide unit - a pre-existing, separate hazard worth its own follow-up.build keeps the full comparison. We prototyped an upstream mode for
tq_cpu_parity(+37/-14: AVX2/AVX-512vs the scalar kernel, bit for bit, catches one-line AVX2 kernel mutations) and can follow up with it if
coverage on the default ggml is wanted.
hip_prefill_mmq_parityon HIP builds with the default ggml fails for the same type-table reason (#3358'slog); that test is HIP-only and is not addressed here.
--benchand--syntheticon an upstream ggml now exit 77 instead of 1, with the same message.passed (SKIP_RETURN_CODE semantics); registering the portable checks as their own test entry would surface
them - a possible follow-up.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.