This is an archive of the discontinued LLVM Phabricator instance.

[mlgo] Simplify autogenerated regalloc model
ClosedPublic

Authored by aidengrossman on Jul 7 2022, 12:15 AM.

Details

Summary

Currently the autogenerated regalloc model will sometimes
output an incorrect LR index to evict instead of the first LR
with with the mask set to 1. This trips an assertion within
the MLRegallocAdvisor that the evicted LR has a mask of 1. This
patch, made possible by https://reviews.llvm.org/D124565, simplifies
the autogenerated model by taking away all unnecessary features and
getting rid of the functions that were previously to mix in all
the necessary inputs so they wouldn't get pruned by the Tensorflow
XLA AOT compiler. This is no longer necessary after the previously
mentioned patch. This also fixes the nondeterministic behavior
that is sometimes observed where the autogenerated model will
simply output 0 instead of the correct index.

Diff Detail

Event Timeline

aidengrossman created this revision.Jul 7 2022, 12:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 7 2022, 12:15 AM
aidengrossman requested review of this revision.Jul 7 2022, 12:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 7 2022, 12:15 AM

This patch removes all unnecessary features from the autogenerated regalloc model (simplifying it greatly) and gets rid of the nondeterminism that I was experiencing that trips the mask==1 assertion in the MLRegallocAdvisor. Not anything super critical, but slightly annoying during development as it has to be commented out and commented back in after feature extraction development is completed and doesn't do what it it is supposed to during development. Tested locally as working and all the tests in /llvm/test/CodeGen/MLRegalloc pass for me as well.

yundiqian accepted this revision.Jul 7 2022, 10:16 AM

mtrofin@ to take a look to confirm as well.

This revision is now accepted and ready to land.Jul 7 2022, 10:16 AM
This revision was landed with ongoing or failed builds.Jul 11 2022, 1:24 PM
This revision was automatically updated to reflect the committed changes.