ROCm / AMDMIGraphX

AMD's graph optimization engine.
https://rocm.docs.amd.com/projects/AMDMIGraphX/en/latest/
MIT License
185 stars 86 forks source link

Use dynamic shapes for kv-cache #3552

Open pfultz2 opened 3 weeks ago

pfultz2 commented 3 weeks ago

There is two parts for this:

  1. Use dynamic shapes to handle the past sequence length.
  2. Similar to dynamic batching, we can make two different submodule for each GQA operator for max sequence length and sequence length of 1. Then use a select operator to select the different module based on the inputs sizes(perhaps its possible to reuse the select from dynamic batching).