Skip to content

ImportError: cannot import name 'TensorCoreTiledLayoutType' #1908

Closed
@andrewor14

Description

@andrewor14

Hi all, I'm still hitting this issue locally even after #1886. It's because my local torchao version is "0.6.0+gitbd09e9d2", so it still fails. My local copy is on the latest torchao main but we haven't bumped the version yet, so it needs the new import but the version guard thinks otherwise.

I propose that we delete the import guard and simply do try catch around the imports instead, e.g.

try:
    # torchao 0.7+
    from torchao.dtypes import TensorCoreTiledLayout
catch ImportError:
    # torchao 0.6 and before
    from torchao.dtypes import TensorCoreTiledLayoutType as TensorCoreTiledLayout

This seems more robust to me, and I already have something similar for migrating QAT out of prototype in this PR: #1883

Thoughts? @jainapurva @joecummings @ebsmothers

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