Skip to content

Conversation

@avv-va
Copy link
Member

@avv-va avv-va commented Mar 20, 2025

This PR sets the default computation device to CPU and enables compatibility with SubProcEnv, which allows the code to leverage multiple processes for parallel execution. To support this, the logic for teammate_collection has to be moved to base_overcooked_env.

Currently, the default is configured not to use multiple processes because of memory issues (the higher the n_envs the more memory). Until that is resolved, we continue to use DummyVecEnv by default.

@avv-va avv-va changed the title WIP: Optmiziations to run faster Optmiziations to run faster Mar 27, 2025
for t_idx in self.t_idxes:
tm = self.get_teammate_from_idx(t_idx)
if type(tm) != CustomAgent:
# if not isinstance(tm, CustomAgent):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are good to not have this comment.

HOW_LONG=20
NUM_OF_CKPOINTS=40
LAYOUT_NAMES="c4_v2"
EXP_DIR=${LAYOUT_NAMES}
Copy link
Collaborator

@Ttopiac Ttopiac Mar 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should EXP_DIR be ${LAYOUT_NAMES}/${NUM_PLAYER}, instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just an experiment that I decided to run this way. For the final experiments we can set them be layout_names/num_player

HOW_LONG=20
NUM_OF_CKPOINTS=40
LAYOUT_NAMES="counter_circuit,coordination_ring,cramped_room,asymmetric_advantages,forced_coordination"
EXP_DIR="Classic/$NUM_PLAYERS" # When quick_test=True this will be overwritten to "Test/$EXP_DIR"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we want to save agents under a directory, mentioning $NUM_PLAYERS, like this one. Although we have it in this scripts, many scripts do not have EXP_DIR mentioning $NUM_PLAYERS.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The directory of best_baseline_experiment is already executed so I am not going to change their scripts. Whenever we add a new script we can follow this template



def best_EGO(args, add_adv=False) -> None:
'''for a very specifric experimetn: only for 2 players:: ignore this'''
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a little typo here. experimetn

Copy link
Member

@Jmiceli17 Jmiceli17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Just a few small questions

self.agent = agent
self.p_idx = p_idx
self.env.set_teammates(teammates)
self.env.set_teammates(teamtype='run_type')
Copy link
Member

@Jmiceli17 Jmiceli17 Apr 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set_teammates just checks if teamtype is set right? I think it'd be better to have teamtype=True here then so we don't think there's something special about the 'run_type' string

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the difference between this and sandbox/profile_analyze.py? do we need both?

print("Training agent: " + self.name + ", for experiment: " + experiment_name)
self.print_tc_helper(self.teammates_collection, "Train TC")
self.print_tc_helper(self.eval_teammates_collection, "Eval TC")
self.print_tc_helper(self.eval_envs[0].teammates_collection[TeammatesCollection.EVAL], "Eval TC")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the teammate collections are always going to be uniform?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants