Skip to content

JIT .so's need a unique prefix to avoid colliding with common modules #599

@stas00

Description

@stas00

When JIT is used (DS_BUILD_OPS=0) ds builds ~/.cache/torch_extensions/utils/utils.so and loads it as import utils (that is sys.modules["utils"] points to ~/.cache/torch_extensions/utils/utils.so) which collides with any local utils.py in the end user application, which are very common. This breaks those applications since they no longer can import the local utils.

Please kindly rename the too generic utils to something specific to deepspeed. e.g. deepspeed_utils.

I'm not sure about the other jit modules, I'd say to be safe probably prefix those with deepspeed as well.

This issue doesn't occur if I build the full binary set using DS_BUILD_OPS=1, as then it doesn't use the extension mechanism and ends up in a very clear unique location: deepspeed/ops/utils_op.cpython-38-x86_64-linux-gnu.so

Thank you.

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