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

Learned parameters from the paper #1

Open
andreas-abel opened this issue Mar 11, 2021 · 8 comments
Open

Learned parameters from the paper #1

andreas-abel opened this issue Mar 11, 2021 · 8 comments

Comments

@andreas-abel
Copy link

Are the learned parameters that were used for Table IV in the paper available in this repository (or elsewhere)?

@alexrenda
Copy link
Contributor

Hey Andreas,

I think I may have overwritten the repeated trials, but here are DiffTune's learned parameters for one trial for each microarchitecture: https://www.dropbox.com/s/vskm0umpha822sp/hsw?dl=0, https://www.dropbox.com/s/d41qc0606h56yca/ivb?dl=0, https://www.dropbox.com/s/gvyyhb95j9itddp/skl?dl=0, https://www.dropbox.com/s/4ma1onalwpypl0u/amd?dl=0. Note that they all use the Haswell resource names despite being trained for different microarchitectures, as our implementation of this sentence in the paper:

Following the default value in llvm-mca for Haswell, we assume that there are 10 execution ports available for dispatch for all microarchitectures.

@andreas-abel
Copy link
Author

Hi Alex,

thanks! How do I tell llvm-mca to use these parameters instead of the default ones?

@alexrenda
Copy link
Contributor

If you compile the parameterized version of llvm-mca with https://github.com/ithemal/DiffTune/blob/master/llvm-mca-parametric/build.sh, then you should be able to use these parameters with:

llvm-mca -parameters PARAMETERS_FILE_NAME -mtriple=x86_64-unknown-unknown -march=x86-64 -mcpu=hsw (as in https://github.com/ithemal/DiffTune/blob/master/difftune/runner.py#L485. Also note mcpu=hsw is necessary for all architectures for llvm-mca to correctly read parameters from the Haswell resource names)

@andreas-abel
Copy link
Author

With mcpu=hsw I get 'hsw' is not a recognized processor for this target (ignoring processor). Should this be -mcpu=haswell?

With echo "nop" | build/bin/llvm-mca -parameters hsw -mtriple=x86_64-unknown-unknown -march=x86-64 -mcpu=haswell I get

Iterations:        100
Instructions:      100
Total Cycles:      27
Total uOps:        100

Dispatch Width:    4
uOps Per Cycle:    3.70
IPC:               3.70
Block RThroughput: 0.3
llvm-mca: DiffTune/llvm-mca-parametric/llvm/lib/MC/MCSchedule.cpp:118: static double llvm::MCSchedModel::getReciprocalThroughput(const llvm::MCSubtargetInfo&, const llvm::MCSchedClassDesc&, unsigned int): Assertion `false' failed.
Stack dump:
0.	Program arguments: build/bin/llvm-mca -parameters hsw -mtriple=x86_64-unknown-unknown -march=x86-64 -mcpu=haswell 
build/bin/llvm-mca(+0xa48f55)[0x561cd72d2f55]
build/bin/llvm-mca(+0xa48fe8)[0x561cd72d2fe8]
build/bin/llvm-mca(+0xa46bcc)[0x561cd72d0bcc]
build/bin/llvm-mca(+0xa48977)[0x561cd72d2977]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12980)[0x7f2171690980]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f2170545fb7]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f2170547921]
/lib/x86_64-linux-gnu/libc.so.6(+0x3048a)[0x7f217053748a]
/lib/x86_64-linux-gnu/libc.so.6(+0x30502)[0x7f2170537502]
build/bin/llvm-mca(+0x897e1a)[0x561cd7121e1a]
build/bin/llvm-mca(+0x3ca550)[0x561cd6c54550]
build/bin/llvm-mca(+0x3c7d48)[0x561cd6c51d48]
build/bin/llvm-mca(+0x3a5700)[0x561cd6c2f700]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f2170528bf7]
build/bin/llvm-mca(+0x3a31aa)[0x561cd6c2d1aa]
Aborted (core dumped)

So it outputs the throughput but crashes afterwards. Is this the expected behavior, or is something wrong?

@alexrenda
Copy link
Contributor

Sorry, yes that was a typo -- should be --mcpu=haswell.

If you add --all-views=0 --summary-view do you still get the error? If not, then it's probably fine — llvm-mca calculates some extra summary statistics (e.g., pipeline utilization) that aren't actually necessary for getting throughput numbers.

@andreas-abel
Copy link
Author

With --all-views=0 --summary-view I don't get the error.

@andreas-abel
Copy link
Author

With these parameters, I get values for Table V that are in several cases quite different from those reported in the paper:
image
Are the values in Table V also the means over different runs of Difftune (like in Table IV), and would this explain the differences?

@alexrenda
Copy link
Contributor

Unfortunately I don’t remember for sure and it seems like it’s not explicit specified in the paper, but it’s very likely that those are from multiple trials (they’d be from the same raw data as Table IV)

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

No branches or pull requests

2 participants