Skip to content

Fix ParallelSGD test step sizes and enable OpenMP for tests when found - #454

Merged
rcurtin merged 5 commits into
mlpack:masterfrom
rcurtin:fix-parallel-sgd-test-step-sizes
Apr 18, 2026
Merged

Fix ParallelSGD test step sizes and enable OpenMP for tests when found#454
rcurtin merged 5 commits into
mlpack:masterfrom
rcurtin:fix-parallel-sgd-test-step-sizes

Conversation

@rcurtin

@rcurtin rcurtin commented Apr 14, 2026

Copy link
Copy Markdown
Member

This is a follow-up for #452. When the tests were refactored for Bandicoot over last summer, one thing that got overlooked was the ParallelSGD tests, since they require OpenMP to be enabled to run... and our CMake configuration did not actually do that even when it found OpenMP! So, two fixes:

  1. Actually enable OpenMP if we find it...

  2. and update the step sizes for each of the ParallelSGD tests since they were way too large and caused divergence.

I ran the tests for 1000 iterations locally with no problems.

Comment thread CMakeLists.txt Outdated
PROPERTY INTERFACE_LINK_LIBRARIES ${OpenMP_CXX_FLAGS} Threads::Threads)
endif()

add_definitions(-DENS_USE_OPENMP)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should it be target_compile_definition instead?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks---my CMake is often pretty primitive. Fixed in fd4362d.

@conradsnicta
conradsnicta requested a review from zoq April 17, 2026 01:38

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Second approval provided automatically after 24 hours. 👍

@rcurtin
rcurtin merged commit 4ecf726 into mlpack:master Apr 18, 2026
1 of 6 checks passed
@rcurtin
rcurtin deleted the fix-parallel-sgd-test-step-sizes branch April 18, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants