test-dependencies

Prepare and validate isolated Python environments for torch_fl tests without replacing the PyTorch build.

12|18|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/flagos-ai/Torch-FL --skill test-dependencies-flagos-ai
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-dependencies
Source: https://github.com/flagos-ai/Torch-FL/tree/main/.claude/skills/test-dependencies
Command: npx skills add https://github.com/flagos-ai/Torch-FL --skill test-dependencies-flagos-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Installing test packages like Transformers can silently replace the vendor-compatible PyTorch build that the compiled torch_fl extension depends on, producing ABI errors and invalid test results. This Skill provides a controlled procedure for installing, pinning, and validating test dependencies so environment problems are never mistaken for backend failures. ## Core Features & Use Cases - ABI Protection: Enforces --no-deps installs and explicit torch version pinning so pip never swaps the torch build underneath torch_fl. - Isolation and Pinning: Recommends one environment per (torch_fl build, torch version, transformers version) tuple with pre-install inspection of interpreter and package versions. - Connectivity Recovery: Provides ordered fallback steps for Hugging Face Hub access using local caches, proxies, and the hf-mirror.com endpoint. - Use Case: Before running official Transformers model tests on a vendor accelerator, install transformers with --no-deps, add accelerate and tokenizers explicitly, run the import and flagos device smoke check, then record the full environment beside the test results. ## Quick Start Set up a validated test environment with transformers and accelerate pinned for my torch_fl build, then run the import and device smoke check before executing the official model tests.

Frequently Asked Questions about test-dependencies

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I install transformers without breaking my PyTorch build?▼

Install transformers with pip --no-deps so the resolver cannot replace the existing torch wheel, then install its non-torch dependencies like accelerate, tokenizers, and safetensors explicitly. Verify afterward with pip check and a torch version comparison.

How to set up a test environment for PyTorch vendor plugins?▼

Create one dedicated environment per torch_fl build, torch version, and transformers version tuple. Install the exact torch build required by the compiled extension first, then add test packages, and run an import plus device smoke check before testing.

Why do Transformers tests fail with missing accelerate errors?▼

Transformers tests using device_map, tp_plan, or torch.device context managers require accelerate, which a --no-deps install does not pull in. Install accelerate explicitly; its absence is an environment failure, not a backend failure.

What to do when Hugging Face Hub is unreachable during tests?▼

First rerun with HF_HUB_OFFLINE=1 if fixtures are cached, then retry through a configured proxy, and finally set HF_ENDPOINT=https://hf-mirror.com as fallback. Record which endpoint the run used but never log proxy credentials.

Can I upgrade torch when a test package requires a newer version?▼

No. The PyTorch build is part of the torch_fl ABI, so upgrading torch invalidates the compiled extension even if imports succeed. Create a separate environment with the exact torch build torch_fl requires instead.