FastVideo icon indicating copy to clipboard operation
FastVideo copied to clipboard

[Feature] Utility class/functions for VSA

Open OutofAi opened this issue 4 months ago • 0 comments

Motivation

Currently the https://github.com/hao-ai-lab/FastVideo/blob/main/csrc/attn/video_sparse_attn/README.md readme lacks a proper example of how to plug n play vsa for a training free comparison with flash attention or sage, would be useful to have a utility class with relevant build function for vsa metadata, or even better a separate class that encapsulate things like

tile_partition_indices = _get_tile_partition_indices(dit_seq_shape, tile_size, device_str)
reverse_tile_partition_indices = _get_reverse_tile_partition_indices(dit_seq_shape, tile_size, device_str)
variable_block_sizes = _construct_variable_block_sizes(dit_seq_shape, num_tiles, device_str)
non_pad_index = _get_non_pad_index(tuple(variable_block_sizes.tolist()), math.prod(tile_size), device_str)

that in forward video_sparse_attn is used and can easily be put in place of flash attention 3 in the training-free approach

Related resources

No response

OutofAi avatar Sep 04 '25 23:09 OutofAi