Skip to content

[BUG] Wrong worker computation for single-CPU systems #3139

@msanft

Description

@msanft

Which component has the problem?

CuTe DSL

Bug Report

Describe the bug
On single-core systems, the following line produces max_workers=0:

# 16 threads max to avoid context switching overhead
# To avoid oversubscription, we use half of cpu_count()
max_workers = min(16, (os.cpu_count() or 8) // 2)

This is then unconditionally passed into ThreadPoolExecutor, which errors for a worker amount of 0.

Steps/Code to reproduce bug
Run cute.compile on a single-core system.

Expected behavior
max_workers=1 should be computed.

Environment details (please complete the following information):

  • Environment location: Single-core VM

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions