"Oserror: [Errno 7] Argumentliste zu lang" in Open (Pfad, 'WB') - Slurm JobPython

Python-Programme
Anonymous
 "Oserror: [Errno 7] Argumentliste zu lang" in Open (Pfad, 'WB') - Slurm Job

Post by Anonymous »

Ich leite einige Jobs in einem Slurm -GPU -Cluster mit dem Python -Paket für Subschritte und erhalte unabdlich einen seltsamen Fehler. Ich habe mehrere Anrufe, um meinen aktuellen Agenten (JAX -Modell) zu speichern, und die meisten von ihnen funktionieren gut. Ich habe os.Environ gedruckt, es ändert sich nicht von Anruf zum Anruf. Die Wege werden auch nicht wesentlich größer (ein Charakter, der höchstens spart mit der gleichen Länge). Ein Beispielpfad ist logs/gcbc_explore_32c_disc-actraj/run_logs/configuration_26/phase_0/Seed_3/params_50000.pkl
Leider habe ich kein reproduzierbares Beispiel, da ich nicht wie ich kann nicht wie ich kann nicht wie ich kann nicht wie ich kann nicht wie ich kann nicht wie ich kann nicht wie ich kann nicht wie Begrenzen Sie es bis jetzt überhaupt. < /p>
1047 │ Traceback (most recent call last):
1048 │ File "", line 198, in _run_module_as_main
1049 │ File "", line 88, in _run_code
1050 │ File "/bigwork/username/.conda/envs/gcrl/lib/python3.12/site-packages/submitit/core/_submit.py", line 11, in
1051 │ submitit_main()
1052 │ File "/bigwork/username/.conda/envs/gcrl/lib/python3.12/site-packages/submitit/core/submission.py", line 76, in submitit_main
1053 │ process_job(args.folder)
1054 │ File "/bigwork/username/.conda/envs/gcrl/lib/python3.12/site-packages/submitit/core/submission.py", line 69, in process_job
1055 │ raise error
1056 │ File "/bigwork/username/.conda/envs/gcrl/lib/python3.12/site-packages/submitit/core/submission.py", line 55, in process_job
1057 │ result = delayed.result()
1058 │ ^^^^^^^^^^^^^^^^
1059 │ File "/bigwork/username/.conda/envs/gcrl/lib/python3.12/site-packages/submitit/core/utils.py", line 137, in result
1060 │ self._result = self.function(*self.args, **self.kwargs)
1061 │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1062 │ File "/bigwork/username/.conda/envs/gcrl/lib/python3.12/site-packages/gcrl_landscapes/main.py", line 250, in run_config_slurm_tas
│ ks_wrapper
1063 │ return run_config(
1064 │ ^^^^^^^^^^^
1065 │ File "/bigwork/username/.conda/envs/gcrl/lib/python3.12/site-packages/gcrl_landscapes/main.py", line 160, in run_config
1066 │ eval_trajectory = train(
1067 │ ^^^^^^
1068 │ File "/bigwork/username/.conda/envs/gcrl/lib/python3.12/site-packages/gcrl_landscapes/training.py", line 270, in train
1069 │ save_agent(agent, str(save_dir), i)
1070 │ File "/bigwork/username/.conda/envs/gcrl/lib/python3.12/site-packages/ogbench/impls/utils/flax_utils.py", line 175, in save_agent
1071 │ with open(save_path, 'wb') as f:
1072 │ ^^^^^^^^^^^^^^^^^^^^^
1073 │ OSError: [Errno 7] Argument list too long
< /code>
Das Senden in den Cluster erfolgt wie folgt. executor = submitit.AutoExecutor(folder=str(args.logdir / "submitit" / "%j"))
executor.update_parameters(
cpus_per_task=4,
slurm_time=int(60 * args.tasks_per_node * ((200000 - args.phase) / 200000)), # this overestimates, keep safety margin
slurm_gpus_per_node=1,
tasks_per_node=args.tasks_per_node,
slurm_mem_per_cpu="1G",
slurm_array_parallelism=50,
slurm_partition=args.partition,
slurm_job_name=args.jobname,
slurm_mail_user=...,
slurm_mail_type="BEGIN,FAIL,END",
)
executor.map_array(run_config_slurm_tasks_wrapper, *chunked_arguments)
< /code>
Der Speicherteil des Codes sieht so aus (aus Ogbench): < /p>
def save_agent(agent, save_dir, epoch):
"""Save the agent to a file.

Args:
agent: Agent.
save_dir: Directory to save the agent.
epoch: Epoch number.
"""

save_dict = dict(
agent=flax.serialization.to_state_dict(agent),
)
save_path = os.path.join(save_dir, f'params_{epoch}.pkl')
with open(save_path, 'wb') as f:
pickle.dump(save_dict, f)

print(f'Saved to {save_path}')
< /code>
Ich weiß, dass dies nicht viel zu tun ist, aber ich habe keine Ideen mehr. Wenn jemand eine Ahnung hat, warum dies geschieht, freue ich mich über jede Hilfe.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post