Use dynamic shapes to handle the past sequence length.
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).
There is two parts for this:
select
from dynamic batching).