Change state tracking interfaces to split properties update

Related-To: NEO-5055

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2023-02-10 09:51:27 +00:00
committed by Compute-Runtime-Automation
parent 429be6b4cb
commit 98b60ba148
25 changed files with 603 additions and 156 deletions

View File

@@ -310,21 +310,23 @@ struct CommandListCoreFamily : CommandListImp {
void dispatchEventRemainingPacketsPostSyncOperation(Event *event);
void dispatchEventPostSyncOperation(Event *event, uint32_t value, bool omitFirstOperation, bool useMax, bool useLastPipeControl);
static constexpr int32_t cmdListDefaultEngineInstancedDevice = NEO::StreamProperty::initValue;
static constexpr bool cmdListDefaultCoherency = false;
static constexpr bool cmdListDefaultDisableOverdispatch = true;
int64_t currentSurfaceStateBaseAddress = -1;
int64_t currentDynamicStateBaseAddress = -1;
int64_t currentIndirectObjectBaseAddress = -1;
int64_t currentBindingTablePoolBaseAddress = -1;
int64_t currentSurfaceStateBaseAddress = NEO::StreamProperty64::initValue;
int64_t currentDynamicStateBaseAddress = NEO::StreamProperty64::initValue;
int64_t currentIndirectObjectBaseAddress = NEO::StreamProperty64::initValue;
int64_t currentBindingTablePoolBaseAddress = NEO::StreamProperty64::initValue;
size_t currentSurfaceStateSize = NEO::StreamPropertySizeT::initValue;
size_t currentDynamicStateSize = NEO::StreamPropertySizeT::initValue;
size_t currentIndirectObjectSize = NEO::StreamPropertySizeT::initValue;
size_t currentBindingTablePoolSize = NEO::StreamPropertySizeT::initValue;
size_t currentSurfaceStateSize = std::numeric_limits<size_t>::max();
size_t currentDynamicStateSize = std::numeric_limits<size_t>::max();
size_t currentIndirectObjectSize = std::numeric_limits<size_t>::max();
size_t currentBindingTablePoolSize = std::numeric_limits<size_t>::max();
size_t cmdListCurrentStartOffset = 0;
int32_t currentMocsState = -1;
int32_t currentMocsState = NEO::StreamProperty::initValue;
bool containsAnyKernel = false;
bool pipeControlMultiKernelEventSync = false;

View File

@@ -118,15 +118,15 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::reset() {
cmdListCurrentStartOffset = 0;
this->returnPoints.clear();
currentSurfaceStateBaseAddress = -1;
currentDynamicStateBaseAddress = -1;
currentIndirectObjectBaseAddress = -1;
currentBindingTablePoolBaseAddress = -1;
currentSurfaceStateBaseAddress = NEO::StreamProperty64::initValue;
currentDynamicStateBaseAddress = NEO::StreamProperty64::initValue;
currentIndirectObjectBaseAddress = NEO::StreamProperty64::initValue;
currentBindingTablePoolBaseAddress = NEO::StreamProperty64::initValue;
currentSurfaceStateSize = std::numeric_limits<size_t>::max();
currentDynamicStateSize = std::numeric_limits<size_t>::max();
currentIndirectObjectSize = std::numeric_limits<size_t>::max();
currentBindingTablePoolSize = std::numeric_limits<size_t>::max();
currentSurfaceStateSize = NEO::StreamPropertySizeT::initValue;
currentDynamicStateSize = NEO::StreamPropertySizeT::initValue;
currentIndirectObjectSize = NEO::StreamPropertySizeT::initValue;
currentBindingTablePoolSize = NEO::StreamPropertySizeT::initValue;
return ZE_RESULT_SUCCESS;
}
@@ -165,8 +165,8 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::initialize(Device *device, NEO
commandContainer.setFlushTaskUsedForImmediate(this->isFlushTaskSubmissionEnabled);
commandContainer.setNumIddPerBlock(1);
requiredStreamState.stateComputeMode.setPropertiesCoherencyDevicePreemption(cmdListDefaultCoherency, this->device->getNEODevice()->getPreemptionMode(), rootDeviceEnvironment);
requiredStreamState.frontEndState.setPropertyDisableOverdispatch(cmdListDefaultDisableOverdispatch, rootDeviceEnvironment);
requiredStreamState.stateComputeMode.setPropertiesCoherencyDevicePreemption(cmdListDefaultCoherency, this->device->getNEODevice()->getPreemptionMode(), rootDeviceEnvironment, true);
requiredStreamState.frontEndState.setPropertiesDisableOverdispatchEngineInstanced(cmdListDefaultDisableOverdispatch, cmdListDefaultEngineInstancedDevice, rootDeviceEnvironment, true);
}
if (this->immediateCmdListHeapSharing) {
@@ -2423,29 +2423,29 @@ void CommandListCoreFamily<gfxCoreFamily>::updateStreamPropertiesForRegularComma
}
}
if (!containsAnyKernel) {
requiredStreamState.frontEndState.setProperties(isCooperative, fusedEuDisabled, cmdListDefaultDisableOverdispatch, -1, rootDeviceEnvironment);
requiredStreamState.pipelineSelect.setProperties(true, false, kernelAttributes.flags.usesSystolicPipelineSelectMode, rootDeviceEnvironment);
requiredStreamState.frontEndState.setPropertiesAll(isCooperative, fusedEuDisabled, cmdListDefaultDisableOverdispatch, cmdListDefaultEngineInstancedDevice, rootDeviceEnvironment);
requiredStreamState.pipelineSelect.setPropertiesAll(true, false, kernelAttributes.flags.usesSystolicPipelineSelectMode, rootDeviceEnvironment);
requiredStreamState.stateBaseAddress.setProperties(kernelImp.getKernelDescriptor().kernelAttributes.flags.useGlobalAtomics, currentMocsState,
currentBindingTablePoolBaseAddress, currentBindingTablePoolSize,
currentSurfaceStateBaseAddress, currentSurfaceStateSize,
currentDynamicStateBaseAddress, currentDynamicStateSize,
currentIndirectObjectBaseAddress, currentIndirectObjectSize,
rootDeviceEnvironment);
requiredStreamState.stateBaseAddress.setPropertiesAll(kernelImp.getKernelDescriptor().kernelAttributes.flags.useGlobalAtomics, currentMocsState,
currentBindingTablePoolBaseAddress, currentBindingTablePoolSize,
currentSurfaceStateBaseAddress, currentSurfaceStateSize,
currentDynamicStateBaseAddress, currentDynamicStateSize,
currentIndirectObjectBaseAddress, currentIndirectObjectSize,
rootDeviceEnvironment);
if (this->stateComputeModeTracking) {
requiredStreamState.stateComputeMode.setProperties(cmdListDefaultCoherency, kernelAttributes.numGrfRequired, kernelAttributes.threadArbitrationPolicy, device->getDevicePreemptionMode(), rootDeviceEnvironment);
requiredStreamState.stateComputeMode.setPropertiesAll(cmdListDefaultCoherency, kernelAttributes.numGrfRequired, kernelAttributes.threadArbitrationPolicy, device->getDevicePreemptionMode(), rootDeviceEnvironment);
finalStreamState = requiredStreamState;
} else {
finalStreamState = requiredStreamState;
requiredStreamState.stateComputeMode.setProperties(cmdListDefaultCoherency, kernelAttributes.numGrfRequired, kernelAttributes.threadArbitrationPolicy, device->getDevicePreemptionMode(), rootDeviceEnvironment);
requiredStreamState.stateComputeMode.setPropertiesAll(cmdListDefaultCoherency, kernelAttributes.numGrfRequired, kernelAttributes.threadArbitrationPolicy, device->getDevicePreemptionMode(), rootDeviceEnvironment);
}
containsAnyKernel = true;
}
auto logicalStateHelperBlock = !getLogicalStateHelper();
finalStreamState.pipelineSelect.setProperties(true, false, kernelAttributes.flags.usesSystolicPipelineSelectMode, rootDeviceEnvironment);
finalStreamState.pipelineSelect.setPropertiesAll(true, false, kernelAttributes.flags.usesSystolicPipelineSelectMode, rootDeviceEnvironment);
if (this->pipelineSelectStateTracking && finalStreamState.pipelineSelect.isDirty() && logicalStateHelperBlock) {
NEO::PipelineSelectArgs pipelineSelectArgs;
pipelineSelectArgs.systolicPipelineSelectMode = kernelAttributes.flags.usesSystolicPipelineSelectMode;
@@ -2456,7 +2456,7 @@ void CommandListCoreFamily<gfxCoreFamily>::updateStreamPropertiesForRegularComma
rootDeviceEnvironment);
}
finalStreamState.frontEndState.setProperties(isCooperative, fusedEuDisabled, cmdListDefaultDisableOverdispatch, -1, rootDeviceEnvironment);
finalStreamState.frontEndState.setPropertiesAll(isCooperative, fusedEuDisabled, cmdListDefaultDisableOverdispatch, cmdListDefaultEngineInstancedDevice, rootDeviceEnvironment);
bool isPatchingVfeStateAllowed = NEO::DebugManager.flags.AllowPatchingVfeStateInCommandLists.get();
if (finalStreamState.frontEndState.isDirty() && logicalStateHelperBlock) {
if (isPatchingVfeStateAllowed) {
@@ -2478,7 +2478,7 @@ void CommandListCoreFamily<gfxCoreFamily>::updateStreamPropertiesForRegularComma
}
}
finalStreamState.stateComputeMode.setProperties(false, kernelAttributes.numGrfRequired, kernelAttributes.threadArbitrationPolicy, device->getDevicePreemptionMode(), rootDeviceEnvironment);
finalStreamState.stateComputeMode.setPropertiesAll(false, kernelAttributes.numGrfRequired, kernelAttributes.threadArbitrationPolicy, device->getDevicePreemptionMode(), rootDeviceEnvironment);
if (finalStreamState.stateComputeMode.isDirty() && logicalStateHelperBlock) {
bool isRcs = (this->engineGroupType == NEO::EngineGroupType::RenderCompute);
NEO::PipelineSelectArgs pipelineSelectArgs;
@@ -2489,12 +2489,12 @@ void CommandListCoreFamily<gfxCoreFamily>::updateStreamPropertiesForRegularComma
*commandContainer.getCommandStream(), finalStreamState.stateComputeMode, pipelineSelectArgs, false, rootDeviceEnvironment, isRcs, this->dcFlushSupport, nullptr);
}
finalStreamState.stateBaseAddress.setProperties(kernelImp.getKernelDescriptor().kernelAttributes.flags.useGlobalAtomics, currentMocsState,
currentBindingTablePoolBaseAddress, currentBindingTablePoolSize,
currentSurfaceStateBaseAddress, currentSurfaceStateSize,
currentDynamicStateBaseAddress, currentDynamicStateSize,
currentIndirectObjectBaseAddress, currentIndirectObjectSize,
rootDeviceEnvironment);
finalStreamState.stateBaseAddress.setPropertiesAll(kernelImp.getKernelDescriptor().kernelAttributes.flags.useGlobalAtomics, currentMocsState,
currentBindingTablePoolBaseAddress, currentBindingTablePoolSize,
currentSurfaceStateBaseAddress, currentSurfaceStateSize,
currentDynamicStateBaseAddress, currentDynamicStateSize,
currentIndirectObjectBaseAddress, currentIndirectObjectSize,
rootDeviceEnvironment);
}
template <GFXCORE_FAMILY gfxCoreFamily>

View File

@@ -619,8 +619,8 @@ void CommandQueueHw<gfxCoreFamily>::setFrontEndStateProperties(CommandListExecut
auto isEngineInstanced = csr->getOsContext().isEngineInstanced();
auto &streamProperties = this->csr->getStreamProperties();
if (!frontEndTrackingEnabled()) {
streamProperties.frontEndState.setProperties(ctx.anyCommandListWithCooperativeKernels, ctx.anyCommandListRequiresDisabledEUFusion,
true, isEngineInstanced, this->device->getNEODevice()->getRootDeviceEnvironment());
streamProperties.frontEndState.setPropertiesAll(ctx.anyCommandListWithCooperativeKernels, ctx.anyCommandListRequiresDisabledEUFusion,
true, isEngineInstanced, this->device->getNEODevice()->getRootDeviceEnvironment());
ctx.frontEndStateDirty |= (streamProperties.frontEndState.isDirty() && !this->csr->getLogicalStateHelper());
} else {
ctx.engineInstanced = isEngineInstanced;