Skip to content
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

Give tests parameterized by shapes better names #406

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

GMNGeoffrey
Copy link
Contributor

This is an example of what I think the change should be, but I didn't want to go through and do it for everything until checking in with others. I found it helpful to have more descriptive test names when working on kernels, especially as you can select by them.

This incidentally also appears to fix a bug that was creating duplicate perf tests. I printed out get_test_shapes("chained_gemm") and got the following:

(8, 128, 128, 64, 256)
(40, 1024, 64, 64, 1024)
ParameterSet(values=((8, 128, 128, 64, 256),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None)
ParameterSet(values=((40, 1024, 64, 64, 1024),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None)
ParameterSet(values=((8, 128, 128, 64, 256),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None)
ParameterSet(values=((40, 1024, 64, 64, 1024),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None)
ParameterSet(values=(ParameterSet(values=((8, 128, 128, 64, 256),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None)
ParameterSet(values=(ParameterSet(values=((40, 1024, 64, 64, 1024),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None)
ParameterSet(values=((8, 128, 128, 64, 256),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None)
ParameterSet(values=((40, 1024, 64, 64, 1024),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None)
ParameterSet(values=(ParameterSet(values=((8, 128, 128, 64, 256),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None)
ParameterSet(values=(ParameterSet(values=((40, 1024, 64, 64, 1024),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None)
ParameterSet(values=(ParameterSet(values=((8, 128, 128, 64, 256),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None)
ParameterSet(values=(ParameterSet(values=((40, 1024, 64, 64, 1024),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None)
ParameterSet(values=(ParameterSet(values=(ParameterSet(values=((8, 128, 128, 64, 256),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None)
ParameterSet(values=(ParameterSet(values=(ParameterSet(values=((40, 1024, 64, 64, 1024),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None),), marks=(MarkDecorator(mark=Mark(name='perf_only', args=(), kwargs={})),), id=None)

Looks like each time shapes.py was imported, the loop adding perf tests got run again.

Before:

testChainedGemm[MMAType.F32_32x32x8_F16-False-shape15]
testChainedGemm[MMAType.F32_32x32x8_F16-False-shape14]
testChainedGemm[MMAType.F32_32x32x8_F16-False-shape13]
testChainedGemm[MMAType.F32_32x32x8_F16-False-shape12]
testChainedGemm[MMAType.F32_32x32x8_F16-False-shape11]
testChainedGemm[MMAType.F32_32x32x8_F16-False-shape10]
testChainedGemm[MMAType.F32_32x32x8_F16-False-shape9]
testChainedGemm[MMAType.F32_32x32x8_F16-False-shape8]
testChainedGemm[MMAType.F32_32x32x8_F16-False-shape7]
testChainedGemm[MMAType.F32_32x32x8_F16-False-shape6]
testChainedGemm[MMAType.F32_32x32x8_F16-False-shape5]
testChainedGemm[MMAType.F32_32x32x8_F16-False-shape4]
testChainedGemm[MMAType.F32_32x32x8_F16-False-shape3]
testChainedGemm[MMAType.F32_32x32x8_F16-False-shape2]
testChainedGemm[MMAType.F32_32x32x8_F16-False-shape1]
testChainedGemm[MMAType.F32_32x32x8_F16-False-shape0]
testChainedGemm[MMAType.F32_16x16x16_F16-False-shape15]
testChainedGemm[MMAType.F32_16x16x16_F16-False-shape14]
testChainedGemm[MMAType.F32_16x16x16_F16-False-shape13]
testChainedGemm[MMAType.F32_16x16x16_F16-False-shape12]
testChainedGemm[MMAType.F32_16x16x16_F16-False-shape11]
testChainedGemm[MMAType.F32_16x16x16_F16-False-shape10]
testChainedGemm[MMAType.F32_16x16x16_F16-False-shape9]
testChainedGemm[MMAType.F32_16x16x16_F16-False-shape8]
testChainedGemm[MMAType.F32_16x16x16_F16-False-shape7]
testChainedGemm[MMAType.F32_16x16x16_F16-False-shape6]
testChainedGemm[MMAType.F32_16x16x16_F16-False-shape5]
testChainedGemm[MMAType.F32_16x16x16_F16-False-shape4]
testChainedGemm[MMAType.F32_16x16x16_F16-False-shape3]
testChainedGemm[MMAType.F32_16x16x16_F16-False-shape2]
testChainedGemm[MMAType.F32_16x16x16_F16-False-shape1]
testChainedGemm[MMAType.F32_16x16x16_F16-False-shape0]

After:

testChainedGemm[MMAType.F32_32x32x8_F16-False-40x1024x64x64x1024-perf]
testChainedGemm[MMAType.F32_32x32x8_F16-False-8x128x128x64x256-perf]
testChainedGemm[MMAType.F32_32x32x8_F16-False-40x1024x64x64x1024]
testChainedGemm[MMAType.F32_32x32x8_F16-False-8x128x128x64x256]
testChainedGemm[MMAType.F32_16x16x16_F16-False-40x1024x64x64x1024-perf]
testChainedGemm[MMAType.F32_16x16x16_F16-False-8x128x128x64x256-perf]
testChainedGemm[MMAType.F32_16x16x16_F16-False-40x1024x64x64x1024]
testChainedGemm[MMAType.F32_16x16x16_F16-False-8x128x128x64x256]

Before:

testGemm[MMAType.F32_32x32x8_F16-True-True-shape5]
testGemm[MMAType.F32_32x32x8_F16-True-True-shape4]
testGemm[MMAType.F32_32x32x8_F16-True-True-shape3]
testGemm[MMAType.F32_32x32x8_F16-True-True-shape2]
testGemm[MMAType.F32_32x32x8_F16-True-True-shape1]
testGemm[MMAType.F32_32x32x8_F16-True-True-shape0]
testGemm[MMAType.F32_32x32x8_F16-True-False-shape5]
testGemm[MMAType.F32_32x32x8_F16-True-False-shape4]
testGemm[MMAType.F32_32x32x8_F16-True-False-shape3]
testGemm[MMAType.F32_32x32x8_F16-True-False-shape2]
testGemm[MMAType.F32_32x32x8_F16-True-False-shape1]
testGemm[MMAType.F32_32x32x8_F16-True-False-shape0]
testGemm[MMAType.F32_32x32x8_F16-False-True-shape5]
testGemm[MMAType.F32_32x32x8_F16-False-True-shape4]
testGemm[MMAType.F32_32x32x8_F16-False-True-shape3]
testGemm[MMAType.F32_32x32x8_F16-False-True-shape2]
testGemm[MMAType.F32_32x32x8_F16-False-True-shape1]
testGemm[MMAType.F32_32x32x8_F16-False-True-shape0]
testGemm[MMAType.F32_32x32x8_F16-False-False-shape5]
testGemm[MMAType.F32_32x32x8_F16-False-False-shape4]
testGemm[MMAType.F32_32x32x8_F16-False-False-shape3]
testGemm[MMAType.F32_32x32x8_F16-False-False-shape2]
testGemm[MMAType.F32_32x32x8_F16-False-False-shape1]
testGemm[MMAType.F32_32x32x8_F16-False-False-shape0]
testGemm[MMAType.F32_16x16x16_F16-True-True-shape5]
testGemm[MMAType.F32_16x16x16_F16-True-True-shape4]
testGemm[MMAType.F32_16x16x16_F16-True-True-shape3]
testGemm[MMAType.F32_16x16x16_F16-True-True-shape2]
testGemm[MMAType.F32_16x16x16_F16-True-True-shape1]
testGemm[MMAType.F32_16x16x16_F16-True-True-shape0]
testGemm[MMAType.F32_16x16x16_F16-True-False-shape5]
testGemm[MMAType.F32_16x16x16_F16-True-False-shape4]
testGemm[MMAType.F32_16x16x16_F16-True-False-shape3]
testGemm[MMAType.F32_16x16x16_F16-True-False-shape2]
testGemm[MMAType.F32_16x16x16_F16-True-False-shape1]
testGemm[MMAType.F32_16x16x16_F16-True-False-shape0]
testGemm[MMAType.F32_16x16x16_F16-False-True-shape5]
testGemm[MMAType.F32_16x16x16_F16-False-True-shape4]
testGemm[MMAType.F32_16x16x16_F16-False-True-shape3]
testGemm[MMAType.F32_16x16x16_F16-False-True-shape2]
testGemm[MMAType.F32_16x16x16_F16-False-True-shape1]
testGemm[MMAType.F32_16x16x16_F16-False-True-shape0]
testGemm[MMAType.F32_16x16x16_F16-False-False-shape5]
testGemm[MMAType.F32_16x16x16_F16-False-False-shape4]
testGemm[MMAType.F32_16x16x16_F16-False-False-shape3]
testGemm[MMAType.F32_16x16x16_F16-False-False-shape2]
testGemm[MMAType.F32_16x16x16_F16-False-False-shape1]
testGemm[MMAType.F32_16x16x16_F16-False-False-shape0]

After:

testGemm[MMAType.F32_16x16x16_F16-no_dyn-no_sched-1024x5120x640]
testGemm[MMAType.F32_16x16x16_F16-no_dyn-no_sched-2048x10240x1280]
testGemm[MMAType.F32_16x16x16_F16-no_dyn-no_sched-4096x20480x2560]
testGemm[MMAType.F32_16x16x16_F16-no_dyn-no_sched-1024x5120x640-perf]
testGemm[MMAType.F32_16x16x16_F16-no_dyn-no_sched-2048x10240x1280-perf]
testGemm[MMAType.F32_16x16x16_F16-no_dyn-no_sched-4096x20480x2560-perf]
testGemm[MMAType.F32_16x16x16_F16-no_dyn-sched-1024x5120x640]
testGemm[MMAType.F32_16x16x16_F16-no_dyn-sched-2048x10240x1280]
testGemm[MMAType.F32_16x16x16_F16-no_dyn-sched-4096x20480x2560]
testGemm[MMAType.F32_16x16x16_F16-no_dyn-sched-1024x5120x640-perf]
testGemm[MMAType.F32_16x16x16_F16-no_dyn-sched-2048x10240x1280-perf]
testGemm[MMAType.F32_16x16x16_F16-no_dyn-sched-4096x20480x2560-perf]
testGemm[MMAType.F32_16x16x16_F16-dyn-no_sched-1024x5120x640]
testGemm[MMAType.F32_16x16x16_F16-dyn-no_sched-2048x10240x1280]
testGemm[MMAType.F32_16x16x16_F16-dyn-no_sched-4096x20480x2560]
testGemm[MMAType.F32_16x16x16_F16-dyn-no_sched-1024x5120x640-perf]
testGemm[MMAType.F32_16x16x16_F16-dyn-no_sched-2048x10240x1280-perf]
testGemm[MMAType.F32_16x16x16_F16-dyn-no_sched-4096x20480x2560-perf]
testGemm[MMAType.F32_16x16x16_F16-dyn-sched-1024x5120x640]
testGemm[MMAType.F32_16x16x16_F16-dyn-sched-2048x10240x1280]
testGemm[MMAType.F32_16x16x16_F16-dyn-sched-4096x20480x2560]
testGemm[MMAType.F32_16x16x16_F16-dyn-sched-1024x5120x640-perf]
testGemm[MMAType.F32_16x16x16_F16-dyn-sched-2048x10240x1280-perf]
testGemm[MMAType.F32_16x16x16_F16-dyn-sched-4096x20480x2560-perf]
testGemm[MMAType.F32_32x32x8_F16-no_dyn-no_sched-1024x5120x640]
testGemm[MMAType.F32_32x32x8_F16-no_dyn-no_sched-2048x10240x1280]
testGemm[MMAType.F32_32x32x8_F16-no_dyn-no_sched-4096x20480x2560]
testGemm[MMAType.F32_32x32x8_F16-no_dyn-no_sched-1024x5120x640-perf]
testGemm[MMAType.F32_32x32x8_F16-no_dyn-no_sched-2048x10240x1280-perf]
testGemm[MMAType.F32_32x32x8_F16-no_dyn-no_sched-4096x20480x2560-perf]
testGemm[MMAType.F32_32x32x8_F16-no_dyn-sched-1024x5120x640]
testGemm[MMAType.F32_32x32x8_F16-no_dyn-sched-2048x10240x1280]
testGemm[MMAType.F32_32x32x8_F16-no_dyn-sched-4096x20480x2560]
testGemm[MMAType.F32_32x32x8_F16-no_dyn-sched-1024x5120x640-perf]
testGemm[MMAType.F32_32x32x8_F16-no_dyn-sched-2048x10240x1280-perf]
testGemm[MMAType.F32_32x32x8_F16-no_dyn-sched-4096x20480x2560-perf]
testGemm[MMAType.F32_32x32x8_F16-dyn-no_sched-1024x5120x640]
testGemm[MMAType.F32_32x32x8_F16-dyn-no_sched-2048x10240x1280]
testGemm[MMAType.F32_32x32x8_F16-dyn-no_sched-4096x20480x2560]
testGemm[MMAType.F32_32x32x8_F16-dyn-no_sched-1024x5120x640-perf]
testGemm[MMAType.F32_32x32x8_F16-dyn-no_sched-2048x10240x1280-perf]
testGemm[MMAType.F32_32x32x8_F16-dyn-no_sched-4096x20480x2560-perf]
testGemm[MMAType.F32_32x32x8_F16-dyn-sched-1024x5120x640]
testGemm[MMAType.F32_32x32x8_F16-dyn-sched-2048x10240x1280]
testGemm[MMAType.F32_32x32x8_F16-dyn-sched-4096x20480x2560]
testGemm[MMAType.F32_32x32x8_F16-dyn-sched-1024x5120x640-perf]
testGemm[MMAType.F32_32x32x8_F16-dyn-sched-2048x10240x1280-perf]
testGemm[MMAType.F32_32x32x8_F16-dyn-sched-4096x20480x2560-perf]

IMO, it's also a bit weird that the perf test param piggy-backs on shapes and then is separately controlled by a command line arg. Could it just be a separate parameter instead with the appropriate mark and the test can read from there rather than directly accessing the command line arg? One disadvantage to that is that in the current proposal there'd then be a "no_perf" suffix on all the non-perf tests. I couldn't figure out a way to my pytest have no id for a test param value (you can do the empty string but it still gets joined on - and your test name looks weird).

WDYT?

@GMNGeoffrey GMNGeoffrey requested a review from harsh-nod January 22, 2025 20:29
Copy link
Contributor

@harsh-nod harsh-nod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks nice, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants