toml-config

작성자: huggingface

prime-rl에서 TOML 설정을 작성하고 사용하는 방법. 설정 파일을 만들거나, 설정과 함께 명령어를 실행하거나, CLI를 통해 설정 값을 재정의할 때 사용합니다.

npx skills add https://github.com/huggingface/prime-rl --skill toml-config

TOML Config

All prime-rl commands use pydantic_config (tyro-backed) with TOML configs and CLI overrides.

Running with configs

# Load a config file with @ syntax
uv run inference @ configs/debug/infer.toml
uv run sft @ configs/debug/sft/train.toml
uv run rl @ configs/debug/rl/train.toml

# CLI overrides (take precedence over TOML)
uv run inference @ config.toml --model.name Qwen/Qwen3-0.6B --server.port 8001

# Boolean flags: no value needed
uv run inference --model.enforce-eager          # sets to true
uv run inference --no-model.enforce-eager       # sets to false

# CLI-only (no TOML file)
uv run inference --model.name Qwen/Qwen3-0.6B --model.max-model-len 2048

# Compose multiple config files (later files override earlier ones)
uv run rl @ examples/reverse_text/rl.toml @ examples/reverse_text/slurm_rl.toml

# Nested config files: load a config for a specific section
uv run rl --model @ model.toml --data @ data.toml

TOML structure

Top-level fields must come before any [section] header — this is a TOML rule.

# Top-level fields first
gpu_memory_utilization = 0.5
seed = 42

# Then sections
[model]
name = "Qwen/Qwen3-0.6B"
max_model_len = 4096

[server]
port = 8000

Putting a top-level field after a section header nests it inside that section, which causes validation errors.

Setting None

Use the string "None" in TOML to set a field to None:

max_model_len = "None"

SLURM mode

Both rl and sft commands support SLURM execution via an optional [slurm] section. When present, the run is submitted as a SLURM job instead of running locally.

SLURM configs are composed with the base config via CLI:

uv run rl @ examples/reverse_text/rl.toml @ examples/reverse_text/slurm_rl.toml

RL SLURM

output_dir = "/shared/experiments/my-run"

[deployment]
type = "multi_node"
num_train_nodes = 2
num_infer_nodes = 1
gpus_per_node = 8
# nodes_per_fsdp_group = 1

[slurm]
job_name = "my-rl-job"
# dry_run = true          # generate script without submitting
# template_path = "path/to/custom.sh.j2"
# project_dir = "/path/to/project"

When [slurm] is set for RL:

  • output_dir must be explicitly set (the default outputs is rejected)
  • Teacher inference is not supported in multi-node deployment

SFT SLURM

output_dir = "/shared/experiments/my-sft-run"

[deployment]
type = "multi_node"
num_nodes = 2
gpus_per_node = 8
# nodes_per_fsdp_group = 1

[slurm]
job_name = "my-sft-job"
# dry_run = true
# template_path = "path/to/custom.sh.j2"
# project_dir = "/path/to/project"

SFT deployment follows the same pattern as RL:

  • [deployment] configures node/GPU allocation (single_node default or multi_node)
  • [slurm] configures SLURM submission (job name, partition, template)
  • output_dir must be explicitly set when using SLURM
  • Multi-node deployment requires [slurm] to be set

Available commands

All accept @ config.toml and CLI overrides:

CommandConfig classDescription
uv run rlfull RL pipelineOrchestrator + inference + trainer (local or SLURM)
uv run inferenceInferenceConfigvLLM inference server
uv run trainertrainer configRL trainer
uv run orchestratororchestrator configRollout orchestrator
uv run env-serverenv server configEnvironment server
uv run sftSFT configSupervised fine-tuning (local or SLURM)

Key files

  • src/prime_rl/utils/config.pyBaseConfig, cli, get_all_fields
  • src/prime_rl/entrypoints/rl.py — unified RL entrypoint (local + SLURM)
  • src/prime_rl/configs/rl.pyRLConfig, SlurmConfig, DeploymentConfig
  • src/prime_rl/entrypoints/sft.py — unified SFT entrypoint (local + SLURM)
  • src/prime_rl/configs/sft.pySFTConfig
  • configs/ — all config files, organized by task

huggingface의 다른 스킬

cpu-kernels
huggingface
C++ CPU 커널을 SIMD 내장 함수(AVX2/AVX512)로 작성, 최적화 및 벤치마킹하는 방법에 대한 지침을 제공하며, Hugging Face 커널 생태계를 대상으로 합니다. 포함 사항…
official
generate-openenv-env
huggingface
구체적인 사용 사례(예: "라이브러리 textarena를 위한 환경 생성")로부터 OpenEnv 환경을 생성합니다. 새로운 환경을 설계하거나 구현하라는 요청을 받았을 때 사용하세요.
official
hf-mcp
huggingface
Hugging Face Hub를 MCP 서버 도구를 통해 사용하세요. 모델, 데이터셋, 스페이스, 논문을 검색하고, 저장소 세부 정보를 확인하며, 문서를 가져오고, 컴퓨팅 작업을 실행하고, Gradio를 사용할 수 있습니다…
official
trl-training
huggingface
트랜스포머 언어 모델을 TRL(Transformers Reinforcement Learning)을 사용하여 학습 및 미세 조정합니다. SFT, DPO, GRPO, KTO, RLOO 및 보상 모델 학습을 지원합니다…
official
deploy-hf
huggingface
OpenEnv 환경을 Hugging Face Spaces에 배포합니다. 배포, Hugging Face로 푸시, 또는 스페이스 업데이트를 요청받았을 때 사용하세요.
official
hf-space-recovery
huggingface
Diagnose and recover failing or stuck Hugging Face Space deployments for OpenEnv environments. Use when deploying envs from `envs/` to the Hub (`openenv`…
official
pre-submit-pr
huggingface
풀 리퀘스트를 제출하기 전에 변경 사항을 검증합니다. 린트, 테스트, 정렬 검토 및 RFC 분석을 포함한 포괄적인 검사를 실행합니다. 생성하기 전에 사용합니다…
official
example-skill
huggingface
액션 스모크 테스트용 예제 픽스처 스킬
official