Skip to content

feat: add a get device type function to utils#416

Merged
simlang merged 2 commits intomainfrom
feat/add-get_device_type-to-utils
Oct 28, 2025
Merged

feat: add a get device type function to utils#416
simlang merged 2 commits intomainfrom
feat/add-get_device_type-to-utils

Conversation

@simlang
Copy link
Copy Markdown
Member

@simlang simlang commented Oct 23, 2025

add a get device type function to utils to have a clear seperation between device, device_type and device_map

Description

Related Issue

Fixes #(issue number)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Additional Notes


Note

Introduce get_device_type in utils and refactor config/tests to use it for device compatibility checks.

  • Utils:
    • Add get_device_type(model) returning the device type via split_device(get_device(model))[0].
    • Export/import updates to include get_device_type.
  • Config (src/pruna/config/pre_smash_routines.py):
    • Use get_device_type(model) instead of split_device(get_device(model))[0] for runs_on checks.
    • Clean up imports (remove cast).
  • Tests (tests/common.py):
    • Replace device assertions to use get_device_type(model).
    • Update imports accordingly.

Written by Cursor Bugbot for commit 31a61d0. This will update automatically on new commits. Configure here.

…ion between device, device_type and device_map
Copy link
Copy Markdown
Member

@begumcig begumcig left a comment

Choose a reason for hiding this comment

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

you are the bestestest

Copy link
Copy Markdown
Member

@johannaSommer johannaSommer left a comment

Choose a reason for hiding this comment

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

I will allow it but I am not pleased

@simlang simlang merged commit d5f58c9 into main Oct 28, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants