refactor: remove not used multi context per engine code

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2024-06-06 10:19:23 +00:00
committed by Compute-Runtime-Automation
parent 01c36a38c6
commit e88127dcc3
10 changed files with 9 additions and 334 deletions

View File

@@ -244,8 +244,6 @@ DECLARE_DEBUG_VARIABLE(int32_t, AdjustThreadGroupDispatchSize, -1, "-1: default,
DECLARE_DEBUG_VARIABLE(int32_t, ForceThreadGroupDispatchSizeAlgorithm, -1, "-1: default, 0: algorithm v1.0 1: algorithm v2.0")
DECLARE_DEBUG_VARIABLE(int32_t, ForceNonblockingExecbufferCalls, -1, "-1: default, 0: make execbuffer call blocking, 1: make execbuffer call nonblocking. Supported only in prelim i915 kernels.")
DECLARE_DEBUG_VARIABLE(int32_t, ForceComputeWalkerPostSyncFlush, -1, "-1: default, 0: disable 1: Enable all flushing bits in ComputeWalker->PostSync")
DECLARE_DEBUG_VARIABLE(int32_t, NumberOfRegularContextsPerEngine, -1, "-1: default, >0: Create more than 1 Regular contexts for the same engine")
DECLARE_DEBUG_VARIABLE(int32_t, EnableMultipleRegularContextForBcs, -1, "-1: default, 0: disabled, 1: Use NumberOfRegularContextsPerEngine to create multiple Regular contexts on the same engine")
DECLARE_DEBUG_VARIABLE(int32_t, AppendAubStreamContextFlags, -1, "-1: default, >0: Append flags passed during HardwareContext creation.")
DECLARE_DEBUG_VARIABLE(int32_t, ContextGroupSize, -1, "-1: default, 0-1: context group disabled, >1: number of contexts in group.")
DECLARE_DEBUG_VARIABLE(int32_t, SecondaryContextEngineTypeMask, -1, "-1: default - all supported engines enabled. != -1: Each mask bit enables engine from EngineType enum (is supported).")

View File

@@ -40,10 +40,6 @@ Device::Device(ExecutionEnvironment *executionEnvironment, const uint32_t rootDe
: executionEnvironment(executionEnvironment), rootDeviceIndex(rootDeviceIndex), isaPoolAllocator(this) {
this->executionEnvironment->incRefInternal();
this->executionEnvironment->rootDeviceEnvironments[rootDeviceIndex]->setDummyBlitProperties(rootDeviceIndex);
if (debugManager.flags.NumberOfRegularContextsPerEngine.get() > 1) {
this->numberOfRegularContextsPerEngine = static_cast<uint32_t>(debugManager.flags.NumberOfRegularContextsPerEngine.get());
}
}
Device::~Device() {
@@ -475,10 +471,6 @@ bool Device::createEngine(uint32_t deviceCsrIndex, EngineTypeUsage engineTypeUsa
commandStreamReceiver->initializeDeviceWithFirstSubmission(*this);
}
if (EngineHelpers::isBcs(engineType) && (defaultBcsEngineIndex == std::numeric_limits<uint32_t>::max()) && (engineUsage == EngineUsage::regular)) {
defaultBcsEngineIndex = deviceCsrIndex;
}
EngineControl engine{commandStreamReceiver.get(), osContext};
allEngines.push_back(engine);
if (engineUsage == EngineUsage::regular) {
@@ -1119,39 +1111,6 @@ BuiltIns *Device::getBuiltIns() const {
return executionEnvironment->rootDeviceEnvironments[getRootDeviceIndex()]->getBuiltIns();
}
EngineControl &Device::getNextEngineForMultiRegularContextMode(aub_stream::EngineType engineType) {
UNRECOVERABLE_IF(defaultEngineIndex != 0);
UNRECOVERABLE_IF((engineType != aub_stream::EngineType::ENGINE_BCS) && (engineType != aub_stream::EngineType::ENGINE_CCS));
const auto maxIndex = numberOfRegularContextsPerEngine - 1; // 1 for internal engine
uint32_t atomicOutValue = 0;
uint32_t indexOffset = 0;
if (engineType == aub_stream::EngineType::ENGINE_CCS) {
atomicOutValue = regularContextPerCcsEngineAssignmentHelper.fetch_add(1);
indexOffset = defaultEngineIndex;
} else {
atomicOutValue = regularContextPerBcsEngineAssignmentHelper.fetch_add(1);
indexOffset = defaultBcsEngineIndex;
}
auto indexToAssign = (atomicOutValue % maxIndex) + indexOffset;
return allEngines[indexToAssign];
}
bool Device::isMultiRegularContextSelectionAllowed(aub_stream::EngineType engineType, EngineUsage engineUsage) const {
if (this->numberOfRegularContextsPerEngine <= 1 || getNumGenericSubDevices() > 1 || engineUsage != EngineUsage::regular) {
return false;
}
if (engineType == aub_stream::EngineType::ENGINE_BCS && debugManager.flags.EnableMultipleRegularContextForBcs.get() == 1) {
return true;
}
return EngineHelpers::isCcs(engineType);
}
const EngineGroupT *Device::tryGetRegularEngineGroup(EngineGroupType engineGroupType) const {
for (auto &engineGroup : regularEngineGroups) {
if (engineGroup.engineGroupType == engineGroupType) {

View File

@@ -107,7 +107,6 @@ class Device : public ReferenceTrackedObject<Device> {
EngineControl &getEngine(uint32_t index);
EngineControl &getDefaultEngine();
EngineControl &getNextEngineForCommandQueue();
EngineControl &getNextEngineForMultiRegularContextMode(aub_stream::EngineType engineType);
EngineControl &getInternalEngine();
EngineControl *getInternalCopyEngine();
SelectorCopyEngine &getSelectorCopyEngine();
@@ -185,8 +184,6 @@ class Device : public ReferenceTrackedObject<Device> {
ISAPoolAllocator &getIsaPoolAllocator() {
return isaPoolAllocator;
}
uint32_t getNumberOfRegularContextsPerEngine() const { return numberOfRegularContextsPerEngine; }
bool isMultiRegularContextSelectionAllowed(aub_stream::EngineType engineType, EngineUsage engineUsage) const;
MOCKABLE_VIRTUAL void stopDirectSubmissionAndWaitForCompletion();
bool isAnyDirectSubmissionEnabled();
bool isStateSipRequired() const {
@@ -252,14 +249,10 @@ class Device : public ReferenceTrackedObject<Device> {
ExecutionEnvironment *executionEnvironment = nullptr;
aub_stream::EngineType engineInstancedType = aub_stream::EngineType::NUM_ENGINES;
uint32_t defaultEngineIndex = 0;
uint32_t defaultBcsEngineIndex = std::numeric_limits<uint32_t>::max();
uint32_t numSubDevices = 0;
std::atomic_uint32_t regularCommandQueuesCreatedWithinDeviceCount{0};
std::atomic<uint8_t> regularContextPerCcsEngineAssignmentHelper = 0;
std::atomic<uint8_t> regularContextPerBcsEngineAssignmentHelper = 0;
std::bitset<8> availableEnginesForCommandQueueusRoundRobin = 0;
uint32_t queuesPerEngineCount = 1;
uint32_t numberOfRegularContextsPerEngine = 1;
void initializeEngineRoundRobinControls();
bool hasGenericSubDevices = false;
bool engineInstanced = false;

View File

@@ -53,7 +53,6 @@ class MockDevice : public RootDevice {
using Device::createDeviceInternals;
using Device::createEngine;
using Device::createSubDevices;
using Device::defaultBcsEngineIndex;
using Device::deviceBitfield;
using Device::deviceInfo;
using Device::engineInstanced;
@@ -63,8 +62,6 @@ class MockDevice : public RootDevice {
using Device::getGlobalMemorySize;
using Device::initializeCaps;
using Device::preemptionMode;
using Device::regularContextPerBcsEngineAssignmentHelper;
using Device::regularContextPerCcsEngineAssignmentHelper;
using Device::regularEngineGroups;
using Device::rootCsrCreated;
using Device::rtMemoryBackedBuffer;

View File

@@ -521,8 +521,6 @@ DirectSubmissionRelaxedOrderingForBcs = -1
OverrideUserFenceStartValue = -1
DirectSubmissionRelaxedOrderingQueueSizeLimit = -1
ExperimentalForceCopyThroughLock = -1
NumberOfRegularContextsPerEngine = -1
EnableMultipleRegularContextForBcs = -1
AppendAubStreamContextFlags = -1
ContextGroupSize=-1
DirectSubmissionRelaxedOrderingMinNumberOfClients = -1

View File

@@ -1014,23 +1014,6 @@ TEST(FailDeviceTest, GivenMidThreadPreemptionAndFailedDeviceWhenCreatingDeviceTh
EXPECT_EQ(nullptr, pDevice);
}
TEST_F(DeviceTests, whenInitializingDeviceThenSetCorrectDefaultBcsEngineIndex) {
if (!defaultHwInfo->capabilityTable.blitterOperationsSupported) {
GTEST_SKIP();
}
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
executionEnvironment.incRefInternal();
UltDeviceFactory deviceFactory{1, 0, executionEnvironment};
auto device = deviceFactory.rootDevices[0];
auto &engine = device->allEngines[device->defaultBcsEngineIndex];
EXPECT_EQ(aub_stream::EngineType::ENGINE_BCS, engine.getEngineType());
EXPECT_EQ(EngineUsage::regular, engine.getEngineUsage());
}
TEST_F(DeviceTests, givenDeviceMidThreadPreemptionWhenDebuggerDisabledThenStateSipRequired) {
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));