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

feat(binpack): improve speed of the environment #100

Open
dluo96 opened this issue Mar 28, 2023 · 2 comments
Open

feat(binpack): improve speed of the environment #100

dluo96 opened this issue Mar 28, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@dluo96
Copy link
Contributor

dluo96 commented Mar 28, 2023

Is your feature request related to a problem? Please describe

There is a potential for speedup in the BinPack environment's step method. If the computation is quite sparse, using jax.lax.map instead of jax.vmap may speed the environment up when lots of EMSs are not alive.

Describe the solution you'd like

  • POC to be done with the timer.
  • Faster version of BinPack's step method.
@dluo96 dluo96 added the enhancement New feature or request label Mar 28, 2023
@djbyrne
Copy link
Contributor

djbyrne commented Mar 28, 2023

How come map will be faster than vmap?

@clement-bonnet
Copy link
Collaborator

Operations done on the EMSs could be conditionally done on whether the EMS exist or not (using map instead of vmap over the EMSs). This would be nice when most EMSs are non-existent. However, this operation is not parallelisable so vmap-ing the whole step function (that includes map over EMSs) will lead to inefficiency because the computation is heterogeneous. A similar solution to the VmapAutoResetWrapper could be done for the step function by splitting the step into 2 components: homogeneous computation and heterogeneous computation, vmap-ing the former and map-ing the latter. But I don't see this as being easy to implement and even having a high potential. So, I think this issue could be closed for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants