Skip to content

Commit 72eea77

Browse files
committed
Add linux test script file, and sota-check for a3c
1 parent ecbec8b commit 72eea77

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

.github/unittest/linux_sota/scripts/test_sota.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@
1515
), "Composite LP must be set to False. Run this test with COMPOSITE_LP_AGGREGATE=0"
1616

1717
commands = {
18+
"a3c_atari": """python sota-implementations/a3c/a3c_atari.py \
19+
collector.total_frames=80 \
20+
collector.frames_per_batch=20 \
21+
loss.mini_batch_size=20 \
22+
logger.backend= \
23+
env.backend=gym \
24+
multiprocessing.num_workers=4
25+
""",
1826
"dt": """python sota-implementations/decision_transformer/dt.py \
1927
optim.pretrain_gradient_steps=55 \
2028
optim.updates_per_episode=3 \

sota-check/run_a3c_atari.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
#SBATCH --job-name=a2c_atari
4+
#SBATCH --ntasks=32
5+
#SBATCH --cpus-per-task=1
6+
#SBATCH --gres=gpu:1
7+
#SBATCH --output=slurm_logs/a2c_atari_%j.txt
8+
#SBATCH --error=slurm_errors/a2c_atari_%j.txt
9+
10+
current_commit=$(git rev-parse --short HEAD)
11+
project_name="torchrl-example-check-$current_commit"
12+
group_name="a3c_atari"
13+
14+
export PYTHONPATH=$(dirname $(dirname $PWD))
15+
python $PYTHONPATH/sota-implementations/a3c/a3c_atari.py \
16+
logger.backend=wandb \
17+
logger.project_name="$project_name" \
18+
logger.group_name="$group_name"
19+
20+
# Capture the exit status of the Python command
21+
exit_status=$?
22+
# Write the exit status to a file
23+
if [ $exit_status -eq 0 ]; then
24+
echo "${group_name}_${SLURM_JOB_ID}=success" >>> report.log
25+
else
26+
echo "${group_name}_${SLURM_JOB_ID}=error" >>> report.log
27+
fi

0 commit comments

Comments
 (0)