-
Notifications
You must be signed in to change notification settings - Fork 237
Fix slow test_patterngen_seeds on Windows by sampling #1461
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
base: main
Are you sure you want to change the base?
Conversation
|
/ok to test c48274e |
| log("done") | ||
|
|
||
|
|
||
| @pytest.mark.skipif( |
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 could leave this in if we want to continue skipping this test on Windows. It is not important to test this on every platform IMO.
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'm 100% for removing this.
|
The test runs in 0.19s on Linux. |
|
| log("done") | ||
|
|
||
|
|
||
| @pytest.mark.skipif( |
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'm 100% for removing this.
cuda_core/tests/test_helpers.py
Outdated
| # especially on Windows. See https://github.com/NVIDIA/cuda-python/issues/1455 | ||
| pgen = PatternGen(device, NBYTES) | ||
| for i in range(256): | ||
| for i in range(0, 256, 17): |
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.
This isn't covering the usual trouble-maker corner case 1 anymore.
This would sample around the usual suspects (0, 1 corner case, then a couple around powers of 2):
(0, 1, 2, 3, 4, 5, 31, 32, 33, 127, 128, 129)
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.
OK, I included values <5 since those are the most common. I don't think there's anything special about powers of two in this case.
Replace exhaustive O(n²) pairwise seed testing with prime-stride sampling, reducing iterations from ~32k to ~100 while maintaining meaningful coverage. Closes NVIDIA#1455
c48274e to
d39f754
Compare
|
/ok to test d39f754 |
rwgk
left a comment
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.
That looks nice!
>>> n = 0
>>> for i in (ii for ii in range(0, 256) if ii < 5 or ii % 17 == 0):
... js = tuple(jj for jj in range(i + 1, 256) if jj < 5 or jj % 19 == 0)
... print(i, js)
... n += len(js)
...
0 (1, 2, 3, 4, 19, 38, 57, 76, 95, 114, 133, 152, 171, 190, 209, 228, 247)
1 (2, 3, 4, 19, 38, 57, 76, 95, 114, 133, 152, 171, 190, 209, 228, 247)
2 (3, 4, 19, 38, 57, 76, 95, 114, 133, 152, 171, 190, 209, 228, 247)
3 (4, 19, 38, 57, 76, 95, 114, 133, 152, 171, 190, 209, 228, 247)
4 (19, 38, 57, 76, 95, 114, 133, 152, 171, 190, 209, 228, 247)
17 (19, 38, 57, 76, 95, 114, 133, 152, 171, 190, 209, 228, 247)
34 (38, 57, 76, 95, 114, 133, 152, 171, 190, 209, 228, 247)
51 (57, 76, 95, 114, 133, 152, 171, 190, 209, 228, 247)
68 (76, 95, 114, 133, 152, 171, 190, 209, 228, 247)
85 (95, 114, 133, 152, 171, 190, 209, 228, 247)
102 (114, 133, 152, 171, 190, 209, 228, 247)
119 (133, 152, 171, 190, 209, 228, 247)
136 (152, 171, 190, 209, 228, 247)
153 (171, 190, 209, 228, 247)
170 (171, 190, 209, 228, 247)
187 (190, 209, 228, 247)
204 (209, 228, 247)
221 (228, 247)
238 (247,)
255 ()
>>> print(n)
171
|
/ok to test a4dcee1 |
|
/ok to test d0454f2 |
Summary
skipifIS_WINDOWSfortest_patterngen_seeds#1456, re-enabling the test on WindowsCloses #1455