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

Support Long Vectors in HLSL #7067

Open
6 tasks
pow2clk opened this issue Jan 13, 2025 · 0 comments
Open
6 tasks

Support Long Vectors in HLSL #7067

pow2clk opened this issue Jan 13, 2025 · 0 comments
Assignees
Labels
enhancement Feature suggestion needs-triage Awaiting triage

Comments

@pow2clk
Copy link
Member

pow2clk commented Jan 13, 2025

Add support for vectors longer than 4 (long vectors) with some restrictions.

Is your feature request related to a problem? Please describe.
ML applications require vectors longer than the graphics-centric limit of 4 vector elements. Allowing longer vectors will better enable these applications to take advantage of hardware support and ease novel ML application development.

Describe the solution you'd like
Allow declaration and use of vectors longer than 4 elements (long vectors) as locals, groupshared, non-entry parameters, non-entry return types, and contents of raw buffers. These should be useable by HLSL operators and elementwise builtins.

These vectors will be declared using the existing template declarations. Existing defaults such as default vector length will be maintained to preserve behavior of existing shaders. Accessing such vectors will be exclusively through existing subscript operation as the member-style xyzw (or rgba) are specific to the interpretation of shorter vectors in a graphics context.

Describe alternatives you've considered
A bespoke, opaque vector type intended for ML applications was considered, but discarded in favor of extending the existing vector representations.

Additional context

While all elementwise DXIL intrinsics are supported, initial support might implement such support as scalarized breakdowns.

Support for this feature may be implemented in stages:

  • declaring long vectors in the various contexts it is supported
  • loading long vectors from byteaddressbuffers
  • loading long vectors from structuredbuffers
  • generating native vectors operations for supported elementwise intrinsics
  • generating scalarized implementations for all other elementwise intrinsics
  • execution tests for hardware support Execution Tests for Long Vectors #7069

Where matrices are represented as vectors, the max size is actually 16. There are many places in the DXC code where the lenght limit of 4 or 16 is pervasive. There are several esoteric changes that need to be made besides just allowing the validator to accept such vectors. Many of these will be included in the changes that require them, but others might require more individual changes along the way.

@pow2clk pow2clk added enhancement Feature suggestion needs-triage Awaiting triage labels Jan 13, 2025
@pow2clk pow2clk self-assigned this Jan 13, 2025
@pow2clk pow2clk moved this to Triaged in HLSL Triage Jan 13, 2025
@pow2clk pow2clk moved this from New to In progress in HLSL Roadmap Jan 13, 2025
@damyanp damyanp moved this to Designing in HLSL Support Jan 13, 2025
@pow2clk pow2clk changed the title [Feature Request] Support Long Vectors Longer in HLSL [Feature Request] Support Long Vectors in HLSL Jan 14, 2025
@damyanp damyanp changed the title [Feature Request] Support Long Vectors in HLSL Support Long Vectors in HLSL Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature suggestion needs-triage Awaiting triage
Projects
Status: In progress
Status: Triaged
Development

No branches or pull requests

1 participant