testing

environment Mar 19, 2026 1 min read

test your environment locally before committing GPU time. a few minutes of local validation catches issues that would otherwise waste an entire training run.

validate_env

validate_env simulates a mini training step locally. it checks every part of the env contract, dataset preprocessing, tool calls, reward computation, pickle serialization (so it survives the trip to the trainer), and a full simulated rollout.

from benchmax.platform.validation import validate_env

validate_env(
    env_class=MyEnv,
    env_args={"api_key": "...", "endpoint": "..."},
    train_dataset=train_data[:5],
    eval_dataset=eval_data[:2],
    pip_dependencies=["httpx", "pandas"],
    local_modules=[my_helpers],
)

if your env imports any pip packages or external .py modules, pass them via pip_dependencies and local_modules — the same lists you give upload_training_run. validate_env bundles them so the validation runs against exactly what the trainer will see.

run it before every launch. if any check fails, the output tells you exactly what broke and how to fix it.