Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiagent #7

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .cache/v/cache/lastfailed
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"tests/test_multiagent_representations.py": true
}
15 changes: 14 additions & 1 deletion control_pcgrl/configs/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ class BinaryPathConfig(ProblemConfig):
name: str = 'binary'
# Regions weight will be 0 by default.
weights: Dict[str, int] = field(default_factory = lambda: ({
# 'player': 1,
# 'create': 1,
# 'target': 1,
# 'regions': 1,
# 'ratio': 1,
# 'dist-win': 1,
# 'sol-length': 2


'path-length': 100,
}))

Expand All @@ -51,6 +60,8 @@ class BinaryControlConfig(ProblemConfig):
@dataclass
class MultiagentConfig:
n_agents: int = MISSING
# valid values: (shared, independent, JSON string)
policies: str = "centralized" # use shared weights by default


@dataclass
Expand Down Expand Up @@ -107,6 +118,7 @@ class ControlPCGRLConfig:
multiagent: MultiagentConfig = MISSING
problem: ProblemConfig = MISSING

algorithm: str = 'PPO'
debug: bool = False
render: bool = False
infer: bool = False
Expand All @@ -117,6 +129,7 @@ class ControlPCGRLConfig:

exp_id: str = '0'
representation: str = 'turtle'
show_agents: bool = False
learning_rate: float = 5e-6
gamma: float = 0.99
map_shape: List[Any] = field(default_factory=lambda:
Expand Down Expand Up @@ -158,4 +171,4 @@ class ControlPCGRLConfig:
cs.store(name="binary_path", group="problem", node=BinaryPathConfig)

cs.store(name="default_model", group="model", node=ModelConfig)
cs.store(name="seqnca", group="model", node=SeqNCAConfig)
cs.store(name="seqnca", group="model", node=SeqNCAConfig)
10 changes: 5 additions & 5 deletions control_pcgrl/configs/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ defaults:
- _self_

# Why can't we override this on the command line?
# - override hydra/launcher: submitit_local
#- override hydra/launcher: submitit_local
- override hydra/launcher: submitit_slurm

hydra:
sweeper:
params:
exp_id: 0, 1, 2
learning_rate: 5e-4, 1e-4, 5e-5, 1e-5, 5e-6, 1e-6
#exp_id: 0, 1, 2
learning_rate: 5e-5

launcher:
tasks_per_node: 1

#FIXME: Can't set this to 1 or 2 even when only asking from 1 ("0") worker from ray...
cpus_per_task: 10
cpus_per_task: 22

gpus_per_node: 1
timeout_min: 1440
timeout_min: 1440 # 1 days of training
mem_gb: 30
# Emails maybe?
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# Parameters
#SBATCH --array=0-3%4
#SBATCH --cpus-per-task=10
#SBATCH --error=/scratch/rd2893/control-pcgrl/control_pcgrl/configs/multirun/2022-11-29/15-04-08/.submitit/%A_%a/%A_%a_0_log.err
#SBATCH --gpus-per-node=1
#SBATCH --job-name=train_ctrl
#SBATCH --mem=30GB
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --open-mode=append
#SBATCH --output=/scratch/rd2893/control-pcgrl/control_pcgrl/configs/multirun/2022-11-29/15-04-08/.submitit/%A_%a/%A_%a_0_log.out
#SBATCH --signal=USR2@120
#SBATCH --time=1440
#SBATCH --wckey=submitit

# command
export SUBMITIT_EXECUTOR=slurm
srun --unbuffered --output /scratch/rd2893/control-pcgrl/control_pcgrl/configs/multirun/2022-11-29/15-04-08/.submitit/%A_%a/%A_%a_%t_log.out --error /scratch/rd2893/control-pcgrl/control_pcgrl/configs/multirun/2022-11-29/15-04-08/.submitit/%A_%a/%A_%a_%t_log.err /scratch/rd2893/miniconda3/envs/pcgrl/bin/python -u -m submitit.core._submit /scratch/rd2893/control-pcgrl/control_pcgrl/configs/multirun/2022-11-29/15-04-08/.submitit/%j
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/scratch/rd2893/miniconda3/envs/pcgrl/lib/python3.7/site-packages/gym/utils/passive_env_checker.py:32: UserWarning: WARN: A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: (16, 16)
"A Box observation space has an unconventional shape (neither an image, nor a 1D vector). "
2022-11-29 15:05:25,106 WARNING env.py:236 -- Your MultiAgentEnv <MultiAgentWrapper<ControlWrapper<CroppedImagePCGRLWrapper<ToImage<OneHotEncoding<Cropped<OrderEnforcing<PcgrlCtrlEnv<binary-turtle-v0>>>>>>>>> does not have some or all of the needed base-class attributes! Make sure you call `super().__init__` from within your MutiAgentEnv's constructor. This will raise an error in the future.
2022-11-29 15:05:27,892 INFO worker.py:1518 -- Started a local Ray instance.
(PPOTrainer pid=3593784) 2022-11-29 15:05:35,626 INFO ppo.py:379 -- In multi-agent mode, policies will be optimized sequentially by the multi-GPU optimizer. Consider setting simple_optimizer=True if this doesn't work for you.
(PPOTrainer pid=3593784) 2022-11-29 15:05:35,628 INFO algorithm.py:358 -- Current log_level is WARN. For more information, set 'log_level': 'INFO' / 'DEBUG' or use the -v and -vv flags.
(PPOTrainer pid=3593784) /scratch/rd2893/miniconda3/envs/pcgrl/lib/python3.7/site-packages/gym/utils/passive_env_checker.py:32: UserWarning: WARN: A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: (16, 16)
(PPOTrainer pid=3593784) "A Box observation space has an unconventional shape (neither an image, nor a 1D vector). "
(PPOTrainer pid=3593784) 2022-11-29 15:05:42,133 WARNING deprecation.py:48 -- DeprecationWarning: `simple_optimizer` has been deprecated. This will raise an error in the future!
(PPOTrainer pid=3593784) 2022-11-29 15:05:42,337 WARNING util.py:66 -- Install gputil for GPU system monitoring.
(PPOTrainer pid=3593784) 2022-11-29 15:05:42,421 WARNING deprecation.py:48 -- DeprecationWarning: `policy_mapping_fn(agent_id)` has been deprecated. Use `policy_mapping_fn(agent_id, episode, worker, **kwargs)` instead. This will raise an error in the future!
(PPOTrainer pid=3593784) 2022-11-29 15:05:44,433 WARNING deprecation.py:48 -- DeprecationWarning: `concat_samples` has been deprecated. Use `concat_samples() from rllib.policy.sample_batch` instead. This will raise an error in the future!
(PPOTrainer pid=3593784) /scratch/rd2893/miniconda3/envs/pcgrl/lib/python3.7/site-packages/ray/rllib/utils/metrics/learner_info.py:110: RuntimeWarning: Mean of empty slice
(PPOTrainer pid=3593784) return np.nanmean(tower_data)
2022-11-30 01:46:43,745 WARNING util.py:244 -- The `callbacks.on_trial_result` operation took 7.095 s, which may be a performance bottleneck.
2022-11-30 01:46:43,747 WARNING util.py:244 -- The `process_trial_result` operation took 7.099 s, which may be a performance bottleneck.
2022-11-30 01:46:43,747 WARNING util.py:244 -- Processing trial results took 7.099 s, which may be a performance bottleneck. Please consider reporting results less frequently to Ray Tune.
2022-11-30 01:46:43,747 WARNING util.py:244 -- The `process_trial_result` operation took 7.100 s, which may be a performance bottleneck.
2022-11-30 01:48:00,324 WARNING util.py:244 -- The `callbacks.on_trial_result` operation took 9.173 s, which may be a performance bottleneck.
2022-11-30 01:48:00,327 WARNING util.py:244 -- The `process_trial_result` operation took 9.178 s, which may be a performance bottleneck.
2022-11-30 01:48:00,331 WARNING util.py:244 -- Processing trial results took 9.182 s, which may be a performance bottleneck. Please consider reporting results less frequently to Ray Tune.
2022-11-30 01:48:00,332 WARNING util.py:244 -- The `process_trial_result` operation took 9.184 s, which may be a performance bottleneck.
2022-11-30 01:50:26,182 WARNING util.py:244 -- The `callbacks.on_trial_result` operation took 6.208 s, which may be a performance bottleneck.
2022-11-30 01:50:26,184 WARNING util.py:244 -- The `process_trial_result` operation took 6.212 s, which may be a performance bottleneck.
2022-11-30 01:50:26,184 WARNING util.py:244 -- Processing trial results took 6.212 s, which may be a performance bottleneck. Please consider reporting results less frequently to Ray Tune.
2022-11-30 01:50:26,184 WARNING util.py:244 -- The `process_trial_result` operation took 6.214 s, which may be a performance bottleneck.
submitit WARNING (2022-11-30 15:02:50,873) - Caught signal SIGUSR2 on gv002.hpc.nyu.edu: this job is timed-out.
submitit WARNING (2022-11-30 15:02:51,153) - Bypassing signal SIGCONT
Traceback (most recent call last):
File "/scratch/rd2893/miniconda3/envs/pcgrl/lib/python3.7/site-packages/submitit/core/job_environment.py", line 226, in checkpoint_and_try_requeue
raise utils.UncompletedJobError(message)
submitit.core.utils.UncompletedJobError: Job not requeued because: timed-out too many times.
Exception ignored in: 'ray._raylet.check_signals'
Traceback (most recent call last):
File "/scratch/rd2893/miniconda3/envs/pcgrl/lib/python3.7/site-packages/submitit/core/job_environment.py", line 226, in checkpoint_and_try_requeue
raise utils.UncompletedJobError(message)
submitit.core.utils.UncompletedJobError: Job not requeued because: timed-out too many times.
slurmstepd: error: *** JOB 27482702 ON gv002 CANCELLED AT 2022-11-30T15:05:22 DUE TO TIME LIMIT ***
slurmstepd: error: *** STEP 27482702.0 ON gv002 CANCELLED AT 2022-11-30T15:05:22 DUE TO TIME LIMIT ***
*** SIGTERM received at time=1669838722 on cpu 6 ***
[failure_signal_handler.cc : 331] RAW: Signal 15 raised at PC=0x14df1d5017b0 while already in AbslFailureSignalHandler()
*** SIGTERM received at time=1669838722 on cpu 6 ***
PC: @ 0x14df1d5017b0 (unknown) absl::lts_20211102::debugging_internal::ParseMangledName()
@ 0x14df25374b20 3424 (unknown)
@ 0x14df1d4fbf78 32 absl::lts_20211102::debugging_internal::DemangleInplace()
@ 0x14df1d4fd4b2 1296 absl::lts_20211102::debugging_internal::(anonymous namespace)::Symbolizer::GetSymbol()
@ 0x14df1d4fd7fe 80 absl::lts_20211102::Symbolize()
@ 0x14df1d4d162d 2144 absl::lts_20211102::debugging_internal::DumpPCAndFrameSizeAndSymbol()
@ 0x14df1d4d1751 192 absl::lts_20211102::debugging_internal::DumpPCAndFrameSizesAndStackTrace()
@ 0x14df1d4d10c6 496 absl::lts_20211102::WriteStackTrace()
@ 0x14df1d4d12d1 80 absl::lts_20211102::AbslFailureSignalHandler()
@ 0x14df25374b20 (unknown) (unknown)
[2022-11-30 15:05:22,384 E 3592250 3592250] logging.cc:361: *** SIGTERM received at time=1669838722 on cpu 6 ***
[2022-11-30 15:05:22,384 E 3592250 3592250] logging.cc:361: PC: @ 0x14df1d5017b0 (unknown) absl::lts_20211102::debugging_internal::ParseMangledName()
[2022-11-30 15:05:22,384 E 3592250 3592250] logging.cc:361: @ 0x14df25374b20 3424 (unknown)
[2022-11-30 15:05:22,384 E 3592250 3592250] logging.cc:361: @ 0x14df1d4fbf78 32 absl::lts_20211102::debugging_internal::DemangleInplace()
[2022-11-30 15:05:22,384 E 3592250 3592250] logging.cc:361: @ 0x14df1d4fd4b2 1296 absl::lts_20211102::debugging_internal::(anonymous namespace)::Symbolizer::GetSymbol()
[2022-11-30 15:05:22,384 E 3592250 3592250] logging.cc:361: @ 0x14df1d4fd7fe 80 absl::lts_20211102::Symbolize()
[2022-11-30 15:05:22,384 E 3592250 3592250] logging.cc:361: @ 0x14df1d4d162d 2144 absl::lts_20211102::debugging_internal::DumpPCAndFrameSizeAndSymbol()
[2022-11-30 15:05:22,384 E 3592250 3592250] logging.cc:361: @ 0x14df1d4d1751 192 absl::lts_20211102::debugging_internal::DumpPCAndFrameSizesAndStackTrace()
[2022-11-30 15:05:22,384 E 3592250 3592250] logging.cc:361: @ 0x14df1d4d10c6 496 absl::lts_20211102::WriteStackTrace()
[2022-11-30 15:05:22,384 E 3592250 3592250] logging.cc:361: @ 0x14df1d4d12d1 80 absl::lts_20211102::AbslFailureSignalHandler()
[2022-11-30 15:05:22,385 E 3592250 3592250] logging.cc:361: @ 0x14df25374b20 (unknown) (unknown)
PC: @ 0x14df2537064a (unknown) pthread_cond_timedwait@@GLIBC_2.3.2
@ 0x14df25374b20 (unknown) (unknown)
[2022-11-30 15:05:22,385 E 3592250 3592250] logging.cc:361: *** SIGTERM received at time=1669838722 on cpu 6 ***
[2022-11-30 15:05:22,385 E 3592250 3592250] logging.cc:361: PC: @ 0x14df2537064a (unknown) pthread_cond_timedwait@@GLIBC_2.3.2
[2022-11-30 15:05:22,385 E 3592250 3592250] logging.cc:361: @ 0x14df25374b20 (unknown) (unknown)
submitit WARNING (2022-11-30 15:05:22,799) - Bypassing signal SIGTERM
submitit WARNING (2022-11-30 15:05:22,819) - Bypassing signal SIGCONT
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/scratch/rd2893/miniconda3/envs/pcgrl/lib/python3.7/site-packages/gym/utils/passive_env_checker.py:32: UserWarning: WARN: A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: (16, 16)
"A Box observation space has an unconventional shape (neither an image, nor a 1D vector). "
2022-11-29 15:05:25,086 WARNING env.py:236 -- Your MultiAgentEnv <MultiAgentWrapper<ControlWrapper<CroppedImagePCGRLWrapper<ToImage<OneHotEncoding<Cropped<OrderEnforcing<PcgrlCtrlEnv<binary-turtle-v0>>>>>>>>> does not have some or all of the needed base-class attributes! Make sure you call `super().__init__` from within your MutiAgentEnv's constructor. This will raise an error in the future.
2022-11-29 15:05:27,858 INFO worker.py:1518 -- Started a local Ray instance.
(PPOTrainer pid=532048) 2022-11-29 15:05:35,162 INFO ppo.py:379 -- In multi-agent mode, policies will be optimized sequentially by the multi-GPU optimizer. Consider setting simple_optimizer=True if this doesn't work for you.
(PPOTrainer pid=532048) 2022-11-29 15:05:35,163 INFO algorithm.py:358 -- Current log_level is WARN. For more information, set 'log_level': 'INFO' / 'DEBUG' or use the -v and -vv flags.
(PPOTrainer pid=532048) /scratch/rd2893/miniconda3/envs/pcgrl/lib/python3.7/site-packages/gym/utils/passive_env_checker.py:32: UserWarning: WARN: A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: (16, 16)
(PPOTrainer pid=532048) "A Box observation space has an unconventional shape (neither an image, nor a 1D vector). "
(PPOTrainer pid=532048) 2022-11-29 15:05:41,998 WARNING deprecation.py:48 -- DeprecationWarning: `simple_optimizer` has been deprecated. This will raise an error in the future!
(PPOTrainer pid=532048) 2022-11-29 15:05:42,202 WARNING util.py:66 -- Install gputil for GPU system monitoring.
(PPOTrainer pid=532048) 2022-11-29 15:05:42,269 WARNING deprecation.py:48 -- DeprecationWarning: `policy_mapping_fn(agent_id)` has been deprecated. Use `policy_mapping_fn(agent_id, episode, worker, **kwargs)` instead. This will raise an error in the future!
(PPOTrainer pid=532048) 2022-11-29 15:05:44,548 WARNING deprecation.py:48 -- DeprecationWarning: `concat_samples` has been deprecated. Use `concat_samples() from rllib.policy.sample_batch` instead. This will raise an error in the future!
(PPOTrainer pid=532048) /scratch/rd2893/miniconda3/envs/pcgrl/lib/python3.7/site-packages/ray/rllib/utils/metrics/learner_info.py:110: RuntimeWarning: Mean of empty slice
(PPOTrainer pid=532048) return np.nanmean(tower_data)
2022-11-30 01:48:00,310 WARNING util.py:244 -- The `callbacks.on_trial_result` operation took 9.325 s, which may be a performance bottleneck.
2022-11-30 01:48:00,312 WARNING util.py:244 -- The `process_trial_result` operation took 9.327 s, which may be a performance bottleneck.
2022-11-30 01:48:00,312 WARNING util.py:244 -- Processing trial results took 9.328 s, which may be a performance bottleneck. Please consider reporting results less frequently to Ray Tune.
2022-11-30 01:48:00,312 WARNING util.py:244 -- The `process_trial_result` operation took 9.329 s, which may be a performance bottleneck.
submitit WARNING (2022-11-30 15:02:50,633) - Caught signal SIGUSR2 on gv005.hpc.nyu.edu: this job is timed-out.
submitit WARNING (2022-11-30 15:02:50,633) - Bypassing signal SIGCONT
Binary file not shown.
Binary file not shown.
Loading