axolotl-ai-cloud--axolotl
78ec5d9290
ci-cd / build-axolotl-uv (<nil>, 130, 13.0.0, linux/amd64,linux/arm64, 3.12, 2.11.0) (push) Has been cancelled
ci-cd / build-axolotl-uv (<nil>, 130, 13.0.0, true, linux/amd64,linux/arm64, 3.12, 2.12.0) (push) Has been cancelled
ci-cd / build-axolotl-cloud-uv (<nil>, 130, 13.0.0, linux/amd64,linux/arm64, 3.12, 2.11.0) (push) Has been cancelled
ci-cd / build-axolotl-cloud-uv (<nil>, 130, 13.0.0, true, linux/amd64,linux/arm64, 3.12, 2.12.0) (push) Has been cancelled
ci-cd / build-axolotl-cloud-no-tmux-uv (<nil>, 130, 13.0.0, linux/amd64,linux/arm64, 3.12, 2.11.0) (push) Has been cancelled
ci-cd / build-axolotl-cloud-no-tmux-uv (<nil>, 130, 13.0.0, true, linux/amd64,linux/arm64, 3.12, 2.12.0) (push) Has been cancelled
ci-cd-base / build-base-uv (130, 13.0.0, , Dockerfile-uv-base, linux/amd64,linux/arm64, 3.12, 2.12.0, 9.0 10.0 10.3 12.0+PTX) (push) Has been cancelled
ci-cd-base / build-base-uv (130, 13.0.0, , Dockerfile-uv-base, linux/amd64,linux/arm64, 3.12, 2.12.1, 9.0 10.0 10.3 12.0+PTX) (push) Has been cancelled
ci-cd-base / build-base-uv (130, 13.0.0, , Dockerfile-uv-base, linux/amd64,linux/arm64, 3.12, 2.13.0, 9.0 10.0 10.3 12.0+PTX) (push) Has been cancelled
ci-cd-base / build-base-uv (132, 13.2.1, , Dockerfile-uv-base, linux/amd64,linux/arm64, 3.12, 2.13.0, 9.0 10.0 10.3 12.0+PTX, https://download.pytorch.org/whl/cu132) (push) Has been cancelled
ci-cd-base / build-base-uv (130, 13.0.0, , Dockerfile-uv-base, linux/amd64,linux/arm64, 3.12, 2.11.0, 9.0 10.0 10.3 12.0+PTX) (push) Has been cancelled
Tests / PyTest (3.12, 2.12.1) (push) Has been cancelled
Tests / PyTest (3.12, 2.13.0) (push) Has been cancelled
docker-e2e-tests / gate-skip-e2e (push) Has been cancelled
docker-e2e-tests / docker-e2e-tests-1st (<nil>, 130, 13.0.0, 1, 3.12, 2.12.1) (push) Has been cancelled
docker-e2e-tests / docker-e2e-tests (<nil>, 130, 13.0.0, 1, 3.12, 2.11.0) (push) Has been cancelled
docker-e2e-tests / docker-e2e-kernel-tests (<nil>, 130, 13.0.0, 1, 3.12, 2.11.0) (push) Has been cancelled
docker-e2e-tests / docker-e2e-kernel-tests (<nil>, 130, 13.0.0, 1, 3.12, 2.12.1) (push) Has been cancelled
docker-e2e-tests / docker-e2e-cleanup (<nil>, 130, 13.0.0, 1, 3.12, 2.12.1) (push) Has been cancelled
Publish Docs / build-deploy (push) Has been cancelled
Tests / PyTest from Source Dist (3.12, 2.11.0) (push) Has been cancelled
Tests / PyTest from Source Dist (3.12, 2.12.1) (push) Has been cancelled
Tests / PyTest from Source Dist (3.12, 2.13.0) (push) Has been cancelled
Tests / pre-commit (push) Has been cancelled
Tests / Prefetch S3 once to prime the CDN cache (push) Has been cancelled
Tests / PyTest (3.12, 2.11.0) (push) Has been cancelled
70 行
1.7 KiB
Python
70 行
1.7 KiB
Python
"""
|
|
unit tests for generating sweep configurations
|
|
"""
|
|
|
|
from axolotl.cli.utils import generate_sweep_configs
|
|
|
|
|
|
def test_generate_sweep_configs_no_pairs():
|
|
base_config = {
|
|
"learning_rate": 0.1,
|
|
"micro_batch_size": 1,
|
|
"sample_packing": True,
|
|
}
|
|
|
|
sweeps_config = {"micro_batch_size": [1, 2, 4], "weight_decay": [0.0, 0.1]}
|
|
|
|
generate_sweep_configs(base_config, sweeps_config)
|
|
|
|
assert len(generate_sweep_configs(base_config, sweeps_config)) == 6
|
|
|
|
cfg_1 = {
|
|
"learning_rate": 0.1,
|
|
"micro_batch_size": 2,
|
|
"weight_decay": 0.0,
|
|
"sample_packing": True,
|
|
}
|
|
|
|
assert any(
|
|
cfg_1 == cfg for cfg in generate_sweep_configs(base_config, sweeps_config)
|
|
)
|
|
|
|
|
|
def test_generate_sweep_configs_with_pairs():
|
|
base_config = {
|
|
"learning_rate": 0.1,
|
|
"micro_batch_size": 1,
|
|
"sample_packing": True,
|
|
}
|
|
|
|
sweeps_config = {
|
|
"_": [
|
|
{
|
|
"micro_batch_size": 1,
|
|
"gradient_accumulation_steps": 8,
|
|
},
|
|
{
|
|
"micro_batch_size": 2,
|
|
"gradient_accumulation_steps": 4,
|
|
},
|
|
{
|
|
"micro_batch_size": 4,
|
|
"gradient_accumulation_steps": 2,
|
|
},
|
|
{
|
|
"micro_batch_size": 8,
|
|
"gradient_accumulation_steps": 1,
|
|
},
|
|
],
|
|
"weight_decay": [0.0, 0.1],
|
|
}
|
|
|
|
generate_sweep_configs(base_config, sweeps_config)
|
|
|
|
assert len(generate_sweep_configs(base_config, sweeps_config)) == 8
|
|
|
|
assert all(
|
|
cfg["gradient_accumulation_steps"] * cfg["micro_batch_size"] == 8
|
|
for cfg in generate_sweep_configs(base_config, sweeps_config)
|
|
)
|