Skip to content

Tensorboard display error for other backends (ex. PrivateUse1) #1306

@SilverSoldier

Description

@SilverSoldier

We are running Profiler + TB for our custom backend using PrivateUse1 as device. The profiler has DeviceType as 20 as per pytorch code .

TB memory profiler sets and uses the device_name, but only checks for DeviceTypes (CPU and CUDA) and returns None for anything else. This throws this error and is not able to display memory in TensorBoard.

  File "...venv/lib/python3.10/site-packages/torch_tb_profiler/run.py", line 292, in get_memory_curve
    devices: List[str] = sorted(list(curves.keys()))
TypeError: '<' not supported between instances of 'str' and 'NoneType'

Proposing that we map the DeviceTypes as per Pytorch and change the device_name function to print the type as name.

Another option is to use the deviceProperties json field (device_props variable) to allow the user to specify the name they want.

I can raise a PR with these changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions