Skip to content

[tests] Re-enable unittesting and partial fix for the existing errors #249

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
Aug 19, 2024

Conversation

Menooker
Copy link

@Menooker Menooker commented Aug 15, 2024

The unit-testing is accidentally disabled since the last refactoring of the test folder. We need to add a dummy folder to hold lig.cfg.py for the C++ based unit tests.

This reveals 2 errors in the current repo.

  • memref-to-cpuruntime should be a function pass in the CPUPipeline (this issue is fixed)
  • unit test failure on TargetDescriptionAnalysis.CPUMissingValue (need to fix in a follow-up PR @zhczhong )

Also fixed an error which breaks g++9, when we need a workaround on the CXX_FLAGS.

@ZhennanQin
Copy link
Contributor

Thank you @Menooker !

check_cxx_compiler_flag("-Wno-unused-but-set-parameter" CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER)
append_if(CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER "-Wno-unused-but-set-parameter" CMAKE_CXX_FLAGS)
if(CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER)
Copy link
Author

Choose a reason for hiding this comment

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

These lines originally occur after including LLVM cmake, so we don't need to include them by ourselves. A recent refactor swaps the location of these lines with include(LLVM...), so it breaks cmake when g++ < 10.0

@crazydemo crazydemo linked an issue Aug 15, 2024 that may be closed by this pull request
@@ -62,7 +62,7 @@ dlti.target_system_spec = #dlti.target_system_spec<
>} {}
)mlir";

TEST(TargetDescriptionAnalysis, CPUMissingValue) {
TEST(DISABLED_TargetDescriptionAnalysis, CPUMissingValue) {
Copy link
Author

Choose a reason for hiding this comment

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

We need to re-enable this UT after it is fixed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a TODO/FIXME for future reminder

@ciyongch
Copy link
Contributor

So this will fix the escape of unittest from CI/CD, right?

@Menooker
Copy link
Author

So this will fix the escape of unittest from CI/CD, right?

Yes. It will!

Comment on lines +26 to +34
if "TMP" in os.environ:
config.environment["TMP"] = os.environ["TMP"]
if "TEMP" in os.environ:
config.environment["TEMP"] = os.environ["TEMP"]

# Propagate HOME as it can be used to override incorrect homedir in passwd
# that causes the tests to fail.
if "HOME" in os.environ:
config.environment["HOME"] = os.environ["HOME"]
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: seems we can also put these into var list below?

@@ -128,7 +128,7 @@ void populateCPURuntimePasses(mlir::OpPassManager &pm) {
pm.addPass(createForallToParallelLoopPass());
pm.addPass(createParallelLoopFusionPass());
pm.addPass(createLoopInvariantCodeMotionPass());
pm.addPass(createConvertMemRefToCPURuntime());
pm.addNestedPass<func::FuncOp>(createConvertMemRefToCPURuntime());
Copy link
Contributor

Choose a reason for hiding this comment

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

can we merge this now? bench tool has an issue for some mlir, and it needs this change.

@ZhennanQin ZhennanQin merged commit 7d9b163 into main Aug 19, 2024
5 checks passed
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.

[UT][BUG] UT ExecutionEngine.JitWrapper faild
6 participants