Skip to content

[Deps] Require laya 0.3.9 and drop the local weight-init skip #28

Description

@Yunaik

Why

#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

  1. Set the extra to laya = ["laya>=0.3.9"] in pyproject.toml and run uv lock --upgrade-package laya.
  2. Remove without_weight_init() and the with block around laya.load in LayaModel.from_env.
  3. 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.
  4. Reword the [Fix] Load Laya without the throwaway random weight init #22 entry in CHANGELOG.md to 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.

  • 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency file

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions