-
Notifications
You must be signed in to change notification settings - Fork 731
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
[SYCL] test update: support single tile PVC #12716
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,14 +10,39 @@ | |
|
||
using namespace sycl; | ||
|
||
template <typename RangeTy, typename ElemTy> | ||
bool contains(RangeTy &&Range, const ElemTy &Elem) { | ||
return std::find(Range.begin(), Range.end(), Elem) != Range.end(); | ||
} | ||
|
||
bool isPartitionableBy(device &Dev, info::partition_property Prop) { | ||
return contains(Dev.get_info<info::device::partition_properties>(), Prop); | ||
} | ||
|
||
bool isPartitionableByAffinityDomain(device &Dev) { | ||
return isPartitionableBy( | ||
Dev, info::partition_property::partition_by_affinity_domain); | ||
} | ||
|
||
bool IsPVC(device &d) { | ||
uint32_t masked_device_id = | ||
d.get_info<ext::intel::info::device::device_id>() & 0xff0; | ||
return masked_device_id == 0xbd0 || masked_device_id == 0xb60; | ||
} | ||
|
||
bool IsPVC_MultiTiles(device &d) { | ||
// PVC-1T (one tile) does not support partitioning by affinity domain, | ||
// which this test requires | ||
Comment on lines
+34
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should support it in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dunno. But if get_info<> returns that it is supported, then the test should be correct regardless. |
||
if (!isPartitionableByAffinityDomain(d)) | ||
return false; | ||
|
||
return IsPVC(d); | ||
} | ||
|
||
void test_pvc(device &d) { | ||
std::cout << "Test PVC Begin" << std::endl; | ||
// CHECK-PVC: Test PVC Begin | ||
bool IsPVC = [&]() { | ||
uint32_t masked_device_id = | ||
d.get_info<ext::intel::info::device::device_id>() & 0xff0; | ||
return masked_device_id == 0xbd0 || masked_device_id == 0xb60; | ||
}(); | ||
bool IsPVC = IsPVC_MultiTiles(d); | ||
std::cout << "IsPVC: " << std::boolalpha << IsPVC << std::endl; | ||
if (IsPVC) { | ||
assert(d.get_info<ext::intel::info::device::max_compute_queue_indices>() == | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
// REQUIRES: gpu-intel-pvc, level_zero | ||
// REQUIRES: aspect-ext_intel_device_id | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need that? We already have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True. I was keeping the IsPVC() test the same for all three of these and it retrieves the device_id. |
||
|
||
// RUN: %{build} %level_zero_options -o %t.out | ||
// RUN: env UR_L0_DEBUG=1 env ZEX_NUMBER_OF_CCS=0:4 %{run} %t.out 2>&1 | FileCheck %s | ||
// RUN: env ZEX_NUMBER_OF_CCS=0:4 %{run} %t.out | ||
|
||
// Check that queues created on sub-sub-devices are going to specific compute | ||
// engines: | ||
auto constexpr expected_output = R"===( | ||
// CHECK: [getZeQueue]: create queue ordinal = 0, index = 0 (round robin in [0, 0]) | ||
// CHECK: [getZeQueue]: create queue ordinal = 0, index = 1 (round robin in [1, 1]) | ||
// CHECK: [getZeQueue]: create queue ordinal = 0, index = 2 (round robin in [2, 2]) | ||
// CHECK: [getZeQueue]: create queue ordinal = 0, index = 3 (round robin in [3, 3]) | ||
)==="; | ||
|
||
#include <chrono> | ||
#include <cmath> | ||
|
@@ -21,6 +24,35 @@ | |
using namespace sycl; | ||
using namespace std::chrono; | ||
|
||
template <typename RangeTy, typename ElemTy> | ||
bool contains(RangeTy &&Range, const ElemTy &Elem) { | ||
return std::find(Range.begin(), Range.end(), Elem) != Range.end(); | ||
} | ||
|
||
bool isPartitionableBy(device &Dev, info::partition_property Prop) { | ||
return contains(Dev.get_info<info::device::partition_properties>(), Prop); | ||
} | ||
|
||
bool isPartitionableByAffinityDomain(device &Dev) { | ||
return isPartitionableBy( | ||
Dev, info::partition_property::partition_by_affinity_domain); | ||
} | ||
|
||
bool IsPVC(device &d) { | ||
uint32_t masked_device_id = | ||
d.get_info<ext::intel::info::device::device_id>() & 0xff0; | ||
return masked_device_id == 0xbd0 || masked_device_id == 0xb60; | ||
} | ||
|
||
bool IsPVC_MultiTiles(device &d) { | ||
// PVC-1T (one tile) does not support partitioning by affinity domain, | ||
// which this test requires | ||
if (!isPartitionableByAffinityDomain(d)) | ||
return false; | ||
|
||
return IsPVC(d); | ||
} | ||
|
||
#define random_float() (rand() / double(RAND_MAX)) | ||
#define INTER_NUM (150) | ||
#define KERNEL_NUM (2000) | ||
|
@@ -91,6 +123,12 @@ int main(void) { | |
|
||
device d; | ||
|
||
// PVC-1T does not support partition by affinity domain | ||
if (!IsPVC_MultiTiles(d)) { | ||
std::cout << expected_output << std::endl; // trick FileCheck | ||
return 0; | ||
} | ||
|
||
Comment on lines
+126
to
+131
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm afraid that if we stop supporting multi-tile cards, the test would keep passing. Do we know if PVC-1T and PVC-2T differ in their device id? If so, can we use that instead of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I only have access to the a PVC-1T, but the IsPVC() test retrieves the device_id and verifies it with a mask. It is returning true for both PVC-1T and PVC-2T. It's possible that they differ in the range of that mask, but I haven't verified that by hand. But rather than key off of some poorly understood device id, I think it's better to do as we are here: actually check that the the AffinityDomain partitioning is available. The test needs it, so its correct to check it. |
||
// watch out device here | ||
auto subdevices = d.create_sub_devices< | ||
info::partition_property::partition_by_affinity_domain>( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should adjust the test to check that even 1T cards can be partitioned by CSlice.