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#5235
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/4894
Author: @XiaoBinGan
Created: 11/1/2026
Status: 🔄 Open
Base:
main← Head:fix/setup-feed-engine-keeps-the-backend📝 Commits (2)
f66b617Fix #4861: the ready-made engine fetch keeps the GPU family setup was told to install4d39db1The fetched package is checked as the family setup was told to use (#4861, second half)📊 Changes
2 files changed (+56 additions, -6 deletions)
View changed files
📝
setup.py(+15 -6)📝
tools/test_setup_feed_engine.py(+41 -0)📄 Description
Problem and result
On a PC that has an AMD card and an NVIDIA card, a source setup run with
--backend hipfetched the CUDA 13 enginepackage for its ready-made engine step, then failed its own test start, and ended where the report began: "no ready-made
AMD engine for this Strata version" - with a 621,585,315-byte CUDA package left in
engine-feed/.updates/partial/.Cause, first half: when the flat HIP zip is not published for this version, setup asks for the ready-made engine by
running
strata.py update --no-controlas a child process. That child detects the GPU itself, and on Windows thedisplay adapters decide first with NVIDIA ahead of AMD. So on a mixed PC the update chose the CUDA package although
setup had already been told
--backend hip; it downloaded it, its test start failed (the CUDA build cannot run on theAMD card), and setup reported the only thing it could see - no usable AMD engine. The family setup chose is now handed
to that child as
STRATA_ENGINE_BACKEND, so a HIP setup fetches the HIP package.Cause, second half (found on the same mixed PC by the reporter of #4861, after the first half was fixed): setup then read
the fetched package back with
ec.resolve(store, full=True)and no family.resolve()runsdetect_backend()whenit is given none, and that is the same detection the fetch path had just bypassed - on a mixed PC it says
cuda. TheHIP package was therefore refused as the wrong make ("This Strata is for AMD RX 9000 cards. Your PC has an NVIDIA card:
download the NVIDIA version ..."), the
EngineMissingwent to setup's top-level handler, and the install stopped onecheck after the fetch. The family is now handed to that check too, so the fetch, the read-back and the run config a HIP
setup writes all name the same make.
Related discussion
#4861 - the report: the run's setup line, the feed's own
failedrecord, the sha256 of the downloaded file matching thefeed's
cuda-cuda13entry, and the HIP package that works on the same PC when installed by hand.exploitmenot's re-run on the mixed AMD+NVIDIA PC -
verified the first half end to end on real hardware and reported the remaining refusal, which this commit fixes; that
comment is also the third-party verification in
## Validationbelow.#3688 / #3835 - the guard that an update never crosses GPU makes: it works on an installation that already has an engine
(the installed make is remembered), but the fresh
engine-feedstore setup uses has no installed engine to remember, sothe child fell back to detection.
Approach
setup.py:engine_from_feed()takes the family setup is installing for and puts it in the child's environment asSTRATA_ENGINE_BACKEND(strata_control.engine_component.ENV_BACKEND). Both HIP call sites pass"hip"; the two flat-zipfallbacks in the standard path pass
"cuda". An empty value keeps the old behaviour (detect), so no other caller changes.ec.resolve(store, full=True, backend=backend or None).A
backendargument is the smallest way to make the run agree: it is the only later read-back in the source setup path(
hip_probe_path()already asks forhip, and the run config and the server take the backend from the config itself),and it does not mutate the environment of every later setup action and subprocess. The child process gets the env value
because it is a separate process - that is the only place an environment value is needed.
(
rx9070,rdna2, ...) from the feed.Validation
Passed (third-party, on a mixed AMD+NVIDIA PC): verified by exploitmenot in
the comment above - Windows 11, AMD Radeon RX 9070
(gfx1201, 16 GB) plus an NVIDIA adapter, Ryzen 9 5900X, a fresh sandbox copy of the 0.2.9 tree with
engine/andengine-feed/removed, commandsetup.py --backend hip --model IQ2_XS --context 32768 --vision no --no-start --yes:setup.py+ this branch's test file ->Ran 6 testsFAILED (failures=2);this branch's
setup.py-> OK; 12 related setup test modules (190 tests) -> 0 failures. (That is the first half,before this commit; those counts are from the tree as it was then. The test file now has 7 cases, including the one for
the read-back below.)
.partfile name is the first 16 hex of the chosen feed entry's sha256, so it names thevariant before any bytes are written: before the fix
34f399a0a22e4af8.part(621,585,315 B, feedcuda-cuda13), withthe fix
83b6e70ed0663182.part(568,281,872 B, feedhip-rx9070). It passed sha256, unpacked asengine-feed/engine/0.1.55-windows-x86_64-hip-rx9070, and the test start ran the engine for real: hipBLASLt tuningenabled (32 rows, gfx1201, version 100500), prompt 53 tokens at 28.6 tok/s, 1 generated in 40 ms (24.9 tok/s), decode
expert cache hit rate 68.7%.
[X] This Strata is for AMD RX 9000 cards. Your PC has an NVIDIA card: download the NVIDIA version from ...and stopped. That is the read-back of## Problem and result's second half,fixed by this commit. (The tester disclosed that the 542 MB transfer was crawling, so he placed the byte-identical
release asset into
partial/83b6e70ed0663182.partand let the run pick it up; the variant choice is observable beforeany bytes arrive and the sha256 check, unpack and test start all ran for real.)
Passed: the new test fails on the previous branch head and passes with this commit. With the previous branch head's
setup.py(everything else including the new test unchanged):With this commit:
The new case drives the real
engine_from_feed()with mock.patch on the childsubprocess.runand onec.resolve:the fetched-package read-back is asserted to be asked for the HIP family. That
resolve(backend=...)itself takes thefamily and never runs the adapter detection is already pinned by
tests/terminal/test_engine_component.py(test_the_package_for_the_backend_is_chosenandtest_another_backend_is_refused_with_the_reason).Passed: the adjacent suites on this checkout (Windows 11, Python 3.11.16):
including the mixed-adapters case that pins NVIDIA-first detection (
test_both_makes_keep_the_usual_order), which is thebehaviour this change deliberately bypasses for the engine fetch and its read-back.
Failed: none.
Not run: a real mixed AMD+NVIDIA PC by me - this machine cannot be one; that run is the third-party verification
quoted above. The tester offered to re-run the same end-to-end once this commit is in, and I have asked him to. The
feed's own signed content was not fetched to check the HIP package for this PC.
Limits
the feed logic still refuses to guess between AMD builds and reports a plain reason - unchanged.
(
control_engine_step()->EC.resolve(full=False), setup.py:7752) is a different entry point with no--backend, soit still detects for itself; it was not part of this report.
releases/latest/download/, which the report notes answers 404 for the engine packagenow) and the rest of setup's vendor choice are not touched.
STRATA_ENGINE_BACKENDkeeps detecting for itself; only setup'sown fetch passes the family it was asked to install.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.