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

Support Python 3.13 #227

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

Conversation

chezou
Copy link
Contributor

@chezou chezou commented Dec 10, 2024

Description

Support Python 3.13 excluding:

  • torch
  • nmslib

PyTorch will likely support Python 3.13 in the coming months.

nmslib-metabrainz only supports until Python 3.12.

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)
  • Optimization

How Has This Been Tested?

Before submitting a PR, please check yourself against the following list. It would save us quite a lot of time.

  • Have you read the contribution guide?
  • Have you updated the relevant docstrings? We're using Numpy format, please double-check yourself
  • Does your change require any new tests?
  • Have you updated the changelog file?

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (9b3992e) to head (1fc04a8).
Report is 87 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##              main      #227     +/-   ##
===========================================
  Coverage   100.00%   100.00%             
===========================================
  Files           45        60     +15     
  Lines         2242      3970   +1728     
===========================================
+ Hits          2242      3970   +1728     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chezou chezou force-pushed the feature/py313 branch 4 times, most recently from 1152e98 to 384dfcc Compare December 10, 2024 21:35
@chezou chezou marked this pull request as ready for review December 11, 2024 00:31
@chezou chezou changed the title Feature/py313 Support Python 3.13 Dec 11, 2024
Makefile Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
tests/models/test_dssm.py Outdated Show resolved Hide resolved
base_model = TFIDFRecommender(K=5, num_threads=2)
# Recreate dataset to prevent same co-occurrence count between (11, 14) and (11, 15)
# which leads to different results in the test in Python 3.13
Copy link
Collaborator

Choose a reason for hiding this comment

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

You mean for the default dataset the results in python 3.8-3.12 and 3.13 are different?
Do you have any idea why is this happening?
Probably the problem is not with the python itself, but with some of the dependencies?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the behavior of implicit ItemKNN changes due to the changes in the similarity matrix.

Considering the cosign similarity, co-occurrence between 11-14 and 11-15 are both 2 times, thus it causes flakiness.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let us take some time to examine this case carefully

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@feldlime Do you need more time?

I think the original dataset can be a bit flaky because the cosine similarities for both two are the same.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Didn't have time to work on this, I'll take another 2-3 weeks

@chezou
Copy link
Contributor Author

chezou commented Dec 11, 2024

@feldlime Applied all the feedback, and CI passed. PTAL

pyproject.toml Outdated Show resolved Hide resolved
chezou and others added 2 commits December 11, 2024 16:14
@chezou
Copy link
Contributor Author

chezou commented Dec 12, 2024

For nmslib, I created Python 3.13 support PR at metabrainz/nmslib-metabrainz#5
I don't expect it will released before this PR. Once it is released, I will create another PR.

@chezou
Copy link
Contributor Author

chezou commented Jan 16, 2025

Test failure is due to upload coverage failure https://github.com/MobileTeleSystems/RecTools/actions/runs/12814286663/job/35730351993

error - 2025-01-16 17:47:40,999 -- Report creating failed: {"message":"Token required because branch is protected"}

@chezou
Copy link
Contributor Author

chezou commented Jan 23, 2025

PyTorch will support Python 3.13 on January 29.
https://dev-discuss.pytorch.org/t/pytorch-release-2-6-0-call-for-features/2574

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