Skip to content

Conversation

@abenmao
Copy link
Contributor

@abenmao abenmao commented Apr 17, 2024

No description provided.

@abenmao abenmao force-pushed the bugfix/layers/mlp branch 3 times, most recently from 073055c to ad6c2c4 Compare April 17, 2024 08:40
@abenmao abenmao force-pushed the bugfix/layers/mlp branch from ad6c2c4 to c47ae2d Compare April 17, 2024 08:47
@abenmao abenmao requested a review from Duyi-Wang April 17, 2024 08:48
@Duyi-Wang Duyi-Wang changed the title [layers] fix assert bug when concat gate&up [Layers] fix assert bug when concat gate&up Apr 17, 2024
add_definitions(-DUSE_SHM=true)
option(XFT_BUILD_TESTS "Build xfastertransformer unit tests" OFF)
if(XFT_BUILD_TESTS)
add_definitions(-DUNDEBUG=true)
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need UNDEBUG?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When we use CMake release, the -DNDEBUG flag is included by default. This option would make all assert statements ineffective as one kind of optimization. I undefine this flag during unit testing (ut) to ensure that assert performs the necessary checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is also why in some environments the assert may fail, while in others it does not. The behavior of assert can vary depending on the compilation settings and the specific conditions.

@abenmao abenmao merged commit 3b2e8b1 into intel:main Apr 18, 2024
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.

3 participants