Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: MAC_M_SERIES enum not found #161

Merged
merged 2 commits into from
Aug 24, 2024
Merged

Fixed: MAC_M_SERIES enum not found #161

merged 2 commits into from
Aug 24, 2024

Conversation

robinjhuang
Copy link
Member

@robinjhuang robinjhuang commented Aug 24, 2024

Because Resolve_Gpu converts a string to a GPU_Option, we need to use the exact same string as upper and lowercase. gpu.uppper converts the previous mac_m_series into MAC_M_SERIES which was a non-existent GPU_OPTION.

@staticmethod
    def Resolve_Gpu(gpu: Union[GPU_OPTION, str, None]):
        if gpu is None:
            try:
                tver = metadata.version("torch")
                if "+cu" in tver:
                    return GPU_OPTION.NVIDIA
                elif "+rocm" in tver:
                    return GPU_OPTION.AMD
                else:
                    return None
            except metadata.PackageNotFoundError:
                return None
        elif isinstance(gpu, str):
            return GPU_OPTION[gpu.upper()]
        else:
            return gpu
            ```

@robinjhuang
Copy link
Member Author

@telamonian Does gpu in uv.py class need to be a Union type of str and the GPU_OPTION enum? That's the root cause of this uncaught bug. What if we just make the gpu value typed as GPU_OPTION?

@telamonian
Copy link
Member

@robinjhuang You make a good point. I think I made that change to make testing during development easier. I often import functions into a notebook cell to mess with them as I develop, eg:

from comfy_cli.uv import DependencyCompiler
dp = DependencyCompiler(gpu="amd", ...)

But there shouldn't be any need for it in the final product. Alright, let me make those changes and I'll add them to this PR

@telamonian telamonian merged commit 712bb5e into main Aug 24, 2024
10 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.

2 participants