You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#22 made --model laya load in about 3 s by running laya.load under transformers' no_init_weights (without_weight_init() in s1a/decision_models/laya.py). Laya 0.3.9, published 2026-09-23, does the same inside laya.load: it builds the model under no_init_weights with the same transformers.initialization / transformers.modeling_utils fallback, checks the checkpoint with _verify_compatibility, then loads it with strict=True (laya/agent.py:327-335 in 0.3.20).
uv.lock pins laya 0.3.5, which predates that change. The before/after numbers in #22 were measured on 0.3.5.
What
Set the extra to laya = ["laya>=0.3.9"] in pyproject.toml and run uv lock --upgrade-package laya.
Remove without_weight_init() and the with block around laya.load in LayaModel.from_env.
Remove the transformers.initialization stubs: TestFromEnv.setUp and the three helper tests in tests/test_decision_models_laya.py, and the stub in tests/test_decision_models_factory.py.
After this, laya checks that the checkpoint fills every weight. The tests no longer stub transformers.
Verification
I have not timed a load on laya 0.3.9 or later.
Repeat the [Fix] Load Laya without the throwaway random weight init #22 measurement on the bumped version: a cold LayaModel.from_env() in a fresh process on CPU with transformers 5.17.0, and s1a decide --model laya end to end. The expected load is about 3 s.
The upgrade includes every laya change from 0.3.6 to the locked version (for example Agent.accelerate()). Compare answers on the default checkpoint against 0.3.5.
uv run pytest -q on the core install and with uv sync --extra laya.
Why
#22 made
--model layaload in about 3 s by runninglaya.loadunder transformers'no_init_weights(without_weight_init()ins1a/decision_models/laya.py). Laya 0.3.9, published 2026-09-23, does the same insidelaya.load: it builds the model underno_init_weightswith the sametransformers.initialization/transformers.modeling_utilsfallback, checks the checkpoint with_verify_compatibility, then loads it withstrict=True(laya/agent.py:327-335in 0.3.20).uv.lockpins laya 0.3.5, which predates that change. The before/after numbers in #22 were measured on 0.3.5.What
laya = ["laya>=0.3.9"]inpyproject.tomland runuv lock --upgrade-package laya.without_weight_init()and thewithblock aroundlaya.loadinLayaModel.from_env.transformers.initializationstubs:TestFromEnv.setUpand the three helper tests intests/test_decision_models_laya.py, and the stub intests/test_decision_models_factory.py.CHANGELOG.mdto name the version bump.After this, laya checks that the checkpoint fills every weight. The tests no longer stub transformers.
Verification
I have not timed a load on laya 0.3.9 or later.
LayaModel.from_env()in a fresh process on CPU with transformers 5.17.0, ands1a decide --model layaend to end. The expected load is about 3 s.Agent.accelerate()). Compare answers on the default checkpoint against 0.3.5.uv run pytest -qon the core install and withuv sync --extra laya.