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

Slot-aligned tensors #235

Open
billschereriii opened this issue Mar 15, 2022 · 0 comments
Open

Slot-aligned tensors #235

billschereriii opened this issue Mar 15, 2022 · 0 comments
Labels
type: feature Issues that include feature request or feature idea

Comments

@billschereriii
Copy link
Contributor

Description

Allow users to pick the slots in which tensors are stored. This should open up an opportunity for advanced users to get improved performance with scripts and models.

Longer explanation

In RedisAI, the AI.SCRIPTRUN/EXECUTE and AI.MODELRUN/EXECUTE commands require that all input and output tensors be aligned to the same slot as the script or model itself. If this is not the case, execution is aborted and a CROSSSLOTS (cross slots) error is issued. In order to ensure this prerequisite, the SmartRedis library currently copies input tensors to the slot with the model/script and then copies output to the target destination. Moving computation to the data instead of data to the computation is a well known performance optimization.

Justification

Advanced users will be able to get better performance from their models and scripts using this approach.

Implementation Strategy

We would add parallel API points for clustered Redis for the following:

  • AlignTensor(): move a tensor to a known slot
  • StoreTensor(): write a tensor a known slot
  • SetModelAligned(): Store a model to a known slot
  • SetScriptAligned(): Store a script to a known slot
  • RunModelAligned(): Execute a model with aligned tensors. No copy of tensor data is performed and CROSSSLOTS errors are returned to users if they occur
  • RunScriptAligned(): Execute a script with aligned tensors. No copy of tensor data is performed and CROSSSLOTS errors are returned to users if they occur

Documentation updates, including a tutorial, would be very helpful to make users understand how to use this functionality.

@billschereriii billschereriii added the type: feature Issues that include feature request or feature idea label Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Issues that include feature request or feature idea
Projects
None yet
Development

No branches or pull requests

1 participant