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

fix: Autorom manual download. #300

Merged
merged 15 commits into from
Aug 19, 2021
Merged

fix: Autorom manual download. #300

merged 15 commits into from
Aug 19, 2021

Conversation

KaleabTessera
Copy link
Contributor

What?

Autorom temp fix.

Why?

How?

Manual install atari roms.

Extra

Copy link
Contributor

@DriesSmit DriesSmit left a comment

Choose a reason for hiding this comment

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

This looks great! Thanks @KaleabTessera 👍 I really like the lp_utils.cpu_only(program) code. Can you maybe do the same for the examples? Something like lp_utils.gpu_trainer_only(program) should probably work.

Copy link
Collaborator

@arnupretorius arnupretorius left a comment

Choose a reason for hiding this comment

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

Thanks @KaleabTessera! 👍


FLAGS = flags.FLAGS


def cpu_only(program: Any) -> Dict:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice 🔥

@arnupretorius
Copy link
Collaborator

arnupretorius commented Aug 19, 2021

This looks great! Thanks @KaleabTessera 👍 I really like the lp_utils.cpu_only(program) code. Can you maybe do the same for the examples? Something like lp_utils.gpu_trainer_only(program) should probably work.

We could also perhaps think about making a to_cpu and to_gpu where you send in only the list of nodes you want to have run on those devices (instead of the entire program). So for example, if you feed something like list(program.groups.keys()) to to_cpu it would be the same as cpu_only.

@DriesSmit DriesSmit self-requested a review August 19, 2021 11:16
Copy link
Contributor

@DriesSmit DriesSmit left a comment

Choose a reason for hiding this comment

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

Can we do the examples conversions here as well? It should be fast right? Or do you want to leave it for future work?

@DriesSmit DriesSmit self-requested a review August 19, 2021 11:17
@KaleabTessera
Copy link
Contributor Author

@DriesSmit I am still adding the example conversions :)

@DriesSmit
Copy link
Contributor

DriesSmit commented Aug 19, 2021

@DriesSmit I am still adding the example conversions :)

Thanks @KaleabTessera 👍 🙌

}
local_resources = lp_utils.to_gpu(
program_nodes=program.groups.keys(), nodes_on_gpu=["trainer"]
)
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks great 🙌 🔥 Thanks @KaleabTessera!

Copy link
Collaborator

@arnupretorius arnupretorius left a comment

Choose a reason for hiding this comment

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

Nice @KaleabTessera!! 😄 Much cleaner than before! Just see my few comments.


Args:
program_nodes (List): nodes in lp program.
nodes_on_gpu (List, optional): nodes to run on gpu. Defaults to ["trainer"].

Returns:
Dict: dict with cpu only lp config.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Edit :)

@@ -65,7 +65,7 @@ def test_recurrent_dial_on_debugging_env(self) -> None:
trainer_node.disable_run()

# Launch gpu config - don't use gpu
local_resources = lp_utils.cpu_only(program)
local_resources = lp_utils.cpu_only(program.groups.keys())
Copy link
Collaborator

@arnupretorius arnupretorius Aug 19, 2021

Choose a reason for hiding this comment

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

I know I suggested feeding in the list, but with the nodes_on_gpu list as an additional argument (specifying the subset of the full list), I think it is cleaner to feed in only the program and keep the for node in program.groups.keys() inside the to_gpu. 😄 That way, the cpu_only looks nice and clean as before. Also, one suggestion is perhaps to have a single util function called to_device which defaults to all cpu if the nodes_on_gpu is empty. What do you think @KaleabTessera? Happy either way, since the former is more clear when reading the code while the latter is more compact.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think having cpu_only and to_gpu taking in a list might be the better option, mainly because it is easier to test. We don't have to initialize a program to test the functions works. From my perspective, passing program or program.groups.keys() seems quite similar in terms of cleaness.

For the to_device function, it sounds like a good idea. I will update the code :)

@KaleabTessera KaleabTessera merged commit 8691afb into develop Aug 19, 2021
@KaleabTessera KaleabTessera deleted the bugfix/autorom branch August 19, 2021 13:56
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.

3 participants