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

Numba #Enhancement #14

Closed
nubonics opened this issue Nov 28, 2021 · 3 comments
Closed

Numba #Enhancement #14

nubonics opened this issue Nov 28, 2021 · 3 comments

Comments

@nubonics
Copy link

Perhaps, I misunderstand [very possible] what numba is for, but maybe it can used to replace learning how to write cuda c code, and instead just write python code that numba can translate [which runs directly on the gpu] into cuda c code?

@Emerald01
Copy link
Collaborator

Emerald01 commented Nov 29, 2021

We always consider Numba as another option to implement the step() function. Yet I think we need to pay attention to some points.

For Numba, if you are saying some built-in implementation for arrays like Numpy did, those functional programming based coding is easy and looks similar to Numpy. However, for a multi-agent RL, it is almost impossible that you can finish your logic by just calling these functions. You will need many custom functionalities, like for loop, complicated logic branching and hashing and so on, and if that is the case, the syntax of Numba is pretty close to CUDA C except that it hides the C pointers. Numba will not translate your Python code to CUDA C code either.

We tested some Numba execution, it is significantly slower than CUDA C with more call-back overhead, but we will try to see if we can release some Numba environment in the near future as well since it is indeed easier to write.

Thank you.

@nubonics
Copy link
Author

Ah okay, I was hoping for an easier way to write cuda c without actually have to write it in anything besides python lols.

Yes, I believe that the .step function is the most expensive, therefore it is definetly worth writing the cuda c step function in order to use warp-drive, because as the name suggests, its at the speed of light!!!

@Emerald01
Copy link
Collaborator

@nubonics the numba is fully supported after version 2.0, and you can refer to example_envs about how those Numba envs are implemented. Thank you.

@Emerald01 Emerald01 reopened this Dec 22, 2022
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

No branches or pull requests

2 participants