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

SNOW-1648322: ML model registration doesn't work when the package name has dot in it #2208

Open
ganius opened this issue Sep 2, 2024 · 4 comments
Assignees
Labels
status-triage_done Initial triage done, will be further handled by the driver team

Comments

@ganius
Copy link

ganius commented Sep 2, 2024

We are trying to log a custom Machine Learning (ML) model to the Snowflake model registry using the log_model method https://docs.snowflake.com/en/developer-guide/snowpark-ml/reference/latest/api/registry/snowflake.ml.registry.Registry

The dependencies are autogluon.tabular and snowflake-ml-python
Below is the code we ran to log the model

custom_model = snowml_registry.log_model(
    my_autogluon_model,
    model_name="autogluon_model_test",
    version_name="version_1",
    conda_dependencies=["autogluon.tabular>=1.0", "snowflake-ml-python"],
    options={"relax_version": False},
    signatures={"predict": predict_sign}, 
    comment='AutoGluon model PoC'
)

The method returns the following error

SnowparkSQLException: (1304): 01b6c2ae-0204-750c-0000-640503c32566: 391546 (XX000): SQL compilation error: Cannot create a Python function with the specified packages. Please check your packages specification and try again. 'Packages not found: - autogluon-tabular[version='>=1.0']'. Hint: These packages are available in other python runtimes:["snowflake-ml-python"->[3.8, 3.10, 3.11], "cloudpickle==2.2.1"->[3.8, 3.10, 3.11]].

The strange part in the error message is that the package that was not found is returned as autogluon-tabular (notice the dash in the name), whereas we pass the correct name of the package autogluon.tabular (with a dot in the name). We suspect that somewhere under the hood the dot in the name of the package is being replaced by a dash and conda is failing to find a package with that name and ultimately failing to log the model.

I found these issues that might be related and/or causing this issue
pypa/pip#3678
pypa/pip#3666

Below are the answers to the generic template for bug reports

Please answer these questions before submitting your issue. Thanks!

  1. What version of Python are you using?

    This happens in all supported versions of Python in Snowpark (3.8 to 3.11)

  2. What operating system and processor architecture are you using?

    We used a Snowpark Optimized Warehouse which are based on a Linux OS with x64 architecture, AFAIK.

  3. What are the component versions in the environment (pip freeze)?

    The package details are provided above

  4. What did you do?

    The steps we took are pretty much the same as in this quickstart, the only difference is that we use Autogluon instead of PyCaret to log a custom model.
    https://quickstarts.snowflake.com/guide/deploying_custom_models_to_snowflake_model_registry/index.html#3

  5. What did you expect to see?

    I expect the model to successfully register.

  6. Can you set logging to DEBUG and collect the logs?
    The debug level logs are attached.
    error.log

@ganius ganius added bug Something isn't working needs triage Initial RCA is required labels Sep 2, 2024
@github-actions github-actions bot changed the title ML model registration doesn't work when the package name has dot in it SNOW-1648322: ML model registration doesn't work when the package name has dot in it Sep 2, 2024
@sfc-gh-sghosh sfc-gh-sghosh self-assigned this Sep 3, 2024
@sfc-gh-sghosh
Copy link

Hello @ganius ,

Thanks for raising the issue; we are checking and will update you.

Regards,
Sujan

@sfc-gh-sghosh
Copy link

Hello @ganius ,

Yes, we are able to reproduce the issue, we are working on eliminating it.

Regards,
Sujan

@sfc-gh-sghosh sfc-gh-sghosh added status-triage_done Initial triage done, will be further handled by the driver team and removed needs triage Initial RCA is required labels Sep 10, 2024
@sfc-gh-sghosh
Copy link

Hello @ganius ,

The model you using its not supported natively, the preprocessing, autogluon does that which is not supported, so could you please create a custom model

The model registry only supports certain types of models: https://docs.snowflake.com/en/developer-guide/snowflake-ml/model-registry/overview
https://docs.snowflake.com/en/developer-guide/snowflake-ml/model-registry/custom-models

Regards,
Sujan

@sfc-gh-sghosh sfc-gh-sghosh removed the bug Something isn't working label Sep 10, 2024
@sfc-gh-sghosh
Copy link

Hello @ganius ,

We will work on fixing the issue from the Snowflake ML side tentatively in the next release.

Regards,
Sujan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status-triage_done Initial triage done, will be further handled by the driver team
Projects
None yet
Development

No branches or pull requests

3 participants