Skip to content

FastForest multithreading #6215

Open
Open

Description

@sretz

System Information (please complete the following information):

  • OS & Version: Windows 10 19044.1706
  • ML.NET Version: 1.7.1 x64
  • .NET Version: v4.8 x64

Describe the bug
I'm running tests with FastForest on machine with 2 processors with 12 cores each with a total of 48 threads, the program running the test is using 48 threads, but the highest CPU the program gets is 14%, which 7 maybe 8 threads. This leads me to believe the FastForest training algo is doing some locking.

To Reproduce
Steps to reproduce the behavior:

  1. Create as many threads as the machine has
  2. var trainer = context.BinaryClassification.Trainers.FastForest(label, numberOfTrees: trees);
  3. var trained = trainer.Fit(inputs);
  4. look at CPU usage

Expected behavior
CPU usage at 100% not significantly less

Screenshots, Code, Sample Projects
image
image

Additional context

Activity

  1. ghost added
    untriagedNew issue has not been triaged
    on Jun 5, 2022
  2. michaelgsharp commented on Jun 13, 2022

    @michaelgsharp
    Contributor

    how many trees are you using? Is there anything else you are doing in your code besides what you listed here?

  3. sretz commented on Jun 14, 2022

    @sretz
    Author

    I am using 2 through 21 trees.
    Here is what I'm doing on the thread.
    image

  4. tarekgh commented on Aug 26, 2022

    @tarekgh
    Member

    It is possible to be the lock

    // REVIEW:Get rid of this lock then we completely remove all static classes from FastTree such as BlockingThreadPool.

  5. added
    area-TreesTree-based trainers, including FastTree and LightGBM
    needs-author-actionMore information or action is needed from the author
    and removed on Sep 8, 2026
  6. dotnet-policy-service commented on Sep 8, 2026

    @dotnet-policy-service
    Contributor

    This issue has been marked needs-author-action and may be missing some important information.

  7. matouskozak commented on Oct 23, 2026

    @matouskozak
    Member

    Triage: This looks like a valid concurrency perf claim. We will investigate when we have more capacity.

  8. added this to the ML.NET Future milestone on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-TreesTree-based trainers, including FastTree and LightGBMtenet-performancePerformance related issueyellowmaintenance only

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions