Skip to content

Add a default CPU stat tracker #1391

@MartinGleize

Description

@MartinGleize

Is your feature request related to a problem? Please describe:

Right now, running a recipe on CPU (e.g. for debugging its initial setup) throws this error from "fairseq2/recipe/internal/device_stat.py":

fairseq2.recipe.error.DeviceTypeNotSupportedError: Only cpu and cuda devices are supported, but the device of the process is cpu.

Because no CPU DeviceStatTracker is registered here: "fairseq2/recipe/composition/device_stat.py".

Describe the solution you would like:

Possible solutions:

  • Amend the error message to be consistent.
  • Register the no-op tracker for the "cpu" type.
  • Provide an actual default CPU stat tracker.

With a preference for the last one (which I think still lets recipe users override to implement their own CPU tracker).

Describe the alternatives you have considered:
As a simple bypass on the recipe implementer side, I simply registered the no-op stat tracker for the "cpu". Recipes are quite convenient!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions