Skip to content

Switch MLIR to use the internal LIT shell by default #65415

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

Merged
merged 2 commits into from
Sep 9, 2023

Conversation

joker-eph
Copy link
Collaborator

No description provided.

@joker-eph joker-eph requested review from a team as code owners September 5, 2023 21:06
@github-actions github-actions bot added the mlir label Sep 5, 2023
@joker-eph joker-eph changed the title Lit internal shell Switch MLIR to use the internal LIT shell by default Sep 5, 2023
if lit_shell_env:
use_lit_shell = not lit.util.pythonize_bool(lit_shell_env)

config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This won't honor the CMake config flag, but it'll respect the environment flag allowing to disable it if needed. Seems like the best I can do right now?

Copy link
Collaborator

Choose a reason for hiding this comment

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

What cmake config flag do you mean?

Copy link
Collaborator Author

@joker-eph joker-eph Sep 6, 2023

Choose a reason for hiding this comment

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

Actually I misremembered, it is controlled by the env var always...

Something to note is that we will still have features.add("shell") added by lit already here (it's not used in MLIR though)

Copy link
Collaborator

Choose a reason for hiding this comment

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

While I haven't tried, I believe you can just add/remove it in config.available_features in this lit.cfg.py... in case someone actually tries to use it one day in MLIR. That's probably for MLIR people to decide.

@jdenny-ornl
Copy link
Collaborator

Thanks for helping us to move away from using external shells in lit.

@@ -18,18 +18,18 @@
//--------------------------------------------------------------------------------------------------

// REDEFINE: %{env} = TENSOR0="%mlir_src_dir/test/Integration/data/test.mtx"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems like it would be easier to put the env command inside the %{env} substitution.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I hesitated, but it seemed that this was written so that %{env} can be redefined at will (even though no test is actually doing do at the moment)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't understand why these tests define and then redefine %{env} exactly once.

Either way, it works, so it's up to MLIR people to decide how to organize this.

if lit_shell_env:
use_lit_shell = not lit.util.pythonize_bool(lit_shell_env)

config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
Copy link
Collaborator

Choose a reason for hiding this comment

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

What cmake config flag do you mean?

Co-authored-by: Joel E. Denny <jdenny.ornl@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants