Name Strings
SPV_INTEL_maximum_registers
Contact
To report problems with this extension, please open a new issue at:
Contributors
-
Ben Ashbaugh, Intel
-
Greg Lueck, Intel
Notice
Copyright (c) 2024 Intel Corporation. All rights reserved.
Status
-
Complete
Version
Last Modified Date |
2024-02-05 |
Revision |
1 |
Dependencies
This extension is written against the SPIR-V Specification, Version 1.6 Revision 3.
This extension requires SPIR-V 1.0.
Overview
This extension adds an execution mode to specify the maximum number of registers a SPIR-V consumer should use when compiling an entry point. This is a hint only that does not modify the functional behavior of the program, but can change its performance characteristics.
Extension Name
To use this extension within a SPIR-V module, the appropriate OpExtension must be present in the module:
OpExtension "SPV_INTEL_maximum_registers"
Modifications to the SPIR-V Specification, Version 1.6
Validation Rules
Add validation rules to section 2.16.1 Universal Validation Rules under Entry Point:
-
Each OpEntryPoint must contain at most one of the MaximumRegistersINTEL, MaximumRegistersIdINTEL, or NamedMaximumRegistersINTEL execution modes.
Capabilities
Modify Section 3.31, Capability, adding rows to the Capability table:
Capability | Implicitly Declares | |
---|---|---|
6460 |
RegisterLimitsINTEL |
Execution Modes
Modify Section 3.6, Execution Mode, adding rows to the Execution Mode table:
Execution Mode | Extra Operands | Enabling Capabilities | |||
---|---|---|---|---|---|
6461 |
MaximumRegistersINTEL |
Literal |
RegisterLimitsINTEL |
||
6462 |
MaximumRegistersIdINTEL |
<id> |
RegisterLimitsINTEL |
||
6463 |
NamedMaximumRegistersINTEL |
Named Maximum Number of Registers |
RegisterLimitsINTEL |
Named Maximum Number of Registers
Add a new Section 3.XX, "Named Maximum Number of Registers":
Specify the maximum number of registers using a named policy. A named maximum number of registers policy is a symbolic name describing desired properties that may influence the maximum number of registers allocated to a single invocation.
Named Maximum Number of Registers | Enabling Capabilities | |
---|---|---|
0 |
AutoINTEL |
RegisterLimitsINTEL |
Issues
-
Do we need to support both the literal and <id> execution modes?
RESOLVED: Because different devices may support differently sized register files it is valuable to support specifying the maximum number of registers using a specialization constant.
-
Should we support other "performance tuning directives" in addition to the maximum number of registers?
RESOLVED: Not in this extension.
-
What should behavior be when no maximum number of registers is specified for an entry point?
RESOLVED: This is outside of the scope of this extension, but for informative purposes: behavior should be considered implementation-defined when no explicit maximum number of registers is specified for an entry point. Some possible valid implementations could be: the compiler chooses a fixed number of registers for simplicity and predictability, or the compiler chooses a number of registers based on heuristics to balance parallelism and register spills.
-
What should the named maximum number of register policy be in the initial version of this extension?
RESOLVED: The name is colloquially known as "auto" therefore it is the name that is used currently.
Note that the behavior is implementation-defined both with this named policy and when the entry point does not describe any specific maximum number of registers, although it is a different implementation, at least for current Intel GPUs.
Revision History
Rev | Date | Author | Changes |
---|---|---|---|
1 |
2024-02-05 |
Ben Ashbaugh |
Initial public revision. |