Skip to content

tests : update for LLAMA_SET_ROWS=1 #14961

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 4 commits into from
Jul 30, 2025
Merged

Conversation

ggerganov
Copy link
Member

target #14960

Extract the test updates from #14959 in a separate PR to be merged before enabling LLAMA_SET_ROWS=1 by default.

Test updates:

  • test-thread-safety
    • limit the number of CPU threads per context to avoid hanging the system in some cases
    • set cparams.n_seq_max = 1
  • embedding
    • default to unified KV cache if -np is not specified
  • save-load-state
    • default to unified KV cache if -np is not specified

@github-actions github-actions bot added testing Everything test related examples labels Jul 30, 2025
Base automatically changed from gg/graph-fix-stack-use-after-return to master July 30, 2025 10:52
@ggerganov ggerganov force-pushed the gg/tests-update-for-set-rows branch from e1ebdea to d6233d6 Compare July 30, 2025 10:53
Comment on lines 37 to 42
// each context has a single sequence
cparams.n_seq_max = 1;

// prevent from launching too many threads
cparams.n_threads = std::min<int>(std::max(2u, std::thread::hardware_concurrency()/params.n_parallel), cparams.n_threads);

Copy link
Member Author

@ggerganov ggerganov Jul 30, 2025

Choose a reason for hiding this comment

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

@slaren Small change to the test to make it compatible with split KV cache. Reduced the number of CPU threads because on the MacBook the process takes a long time (several minutes) to terminate (think it's some resource congestion when there are many threads started by the process, not sure).

Copy link
Member

Choose a reason for hiding this comment

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

This is a known issue with the thread pool implementation, using more threads than available will result in the threads spending more time spinning than doing work.

Copy link
Member

Choose a reason for hiding this comment

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

I am not convinced that it is good to ignore the parameters of the user to workaround what essentially is a bug. Can this be solved by running the test with -t 1?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, -t 1 works. I was thinking to use -t 2 so we have context-level concurrency too. With -t 2 the test also runs cleanly on my devices.

@ggerganov ggerganov requested a review from slaren July 30, 2025 11:46
@ggerganov ggerganov merged commit 00131d6 into master Jul 30, 2025
54 of 55 checks passed
@ggerganov ggerganov deleted the gg/tests-update-for-set-rows branch July 30, 2025 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
examples testing Everything test related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants