-
Notifications
You must be signed in to change notification settings - Fork 17
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
Batched execution #100
Comments
This is a tricky problem, which will be very helpful to have. There are still two cases to be considered, e.g. batch evaluation of The The changing For bookkeeping purposes, the general feature I would like is the ability to perform fast calculation of outgoing beam parameters for one static incoming beam, and vectorized accelerator settings with the general form Currently, I have to do something like: def forward(self, X: torch.Tensor) -> torch.Tensor:
input_shape = X.shape
X = X.reshape(-1, n_dim)
Y = torch.zeros(X.shape[:-1])
for i, x in enumerate(X):
self.segment.Q1.k1 = x[0] # Set the input parameters
...
# Track the beam
out_beam = self.segment(self.incoming_beam)
# Compute the objective
obj = ...
Y[i] = obj
return Y.reshape(input_shape[:-1]) which more or less scale linearly (poorly):
|
Maybe we can take inspiration from how this was done here: https://github.com/UM-ARM-Lab/pytorch_kinematics |
It would be in the spirit of the Cheetah's applications, to enable batched execution. This would be, for example, that a quadrupole's strength is set to vector of strengths, which would then result in a 3D tensor of transfer maps and allow parallel evaluations at much higher speed.
The text was updated successfully, but these errors were encountered: