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

update for neptune 1.0 #934

Merged
merged 9 commits into from
Mar 17, 2023

Conversation

kshitij12345
Copy link
Contributor

No description provided.

Copy link
Contributor Author

@kshitij12345 kshitij12345 left a comment

Choose a reason for hiding this comment

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

try:
# neptune-client=0.9.0+ package structure
from neptune.new.types import File
except ImportError:
# neptune-client>=1.0.0 package structure
from neptune.types import File

Update based on the decided approach.

@BenjaminBossan
Copy link
Collaborator

@kshitij12345 Thanks for the PR. Are you with Neptune?

@kshitij12345
Copy link
Contributor Author

kshitij12345 commented Feb 24, 2023

Hi @BenjaminBossan,

Yes. I am with Neptune. Currently the PR is in draft and have asked other members to do a preliminary review.

Once it is ready, I will mark this ready and ping you. Does that work?

Thanks!

@BenjaminBossan
Copy link
Collaborator

Okay, great, that works. I only asked to ensure that folks at Neptune are okay with dropping support for the old client.

Comment on lines +238 to +241
try: # >1.0 package structure
from neptune.handler import Handler
except ImportError: # <1.0 package structure
from neptune.new.handler import Handler
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be just

from neptune.handler import Handler

given that the dependency is v >=1.0.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is actual logging code which should be compatible with both pre and post 1.0.

Other update where we assume 1.0 structure is in test (where we have updated the requirements to install latest version).

Copy link
Contributor

@twolodzko twolodzko Mar 3, 2023

Choose a reason for hiding this comment

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

But the requirements say neptune hence >=1.0.0, so there is no backward compatibility assumed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is the requirements for development. Installing skorch as a user doesn't install neptune. So we could have users who may use older neptune-client.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is all the code compatible with older versions? E.g. the use of append instead of log. If not, there is no point in having this check.

I think it's fine to tell users to install the latest version of neptune (except if you know that users are reluctant to upgrade versions). E.g. when this class is initialized, there could be a version check and a helpful error message when the version is too low. WDYT?

kshitij12345 and others added 2 commits March 16, 2023 13:43
Co-authored-by: Sabine <sabine.nyholm@neptune.ai>
@kshitij12345 kshitij12345 requested a review from normandy7 March 16, 2023 08:14
@BenjaminBossan
Copy link
Collaborator

I got an error in a CI run that seems to be related to Neptune:

>       assert isinstance(
            neptune_run_object.get_structure()['training']['model']['checkpoint'],
            FileSet,
        )
E       AssertionError: assert False
E        +  where False = isinstance(<neptune.attributes.file_set.FileSet object at 0x7f942dcdd850>, <class 'neptune.new.attributes.file_set.FileSet'>)

https://github.com/skorch-dev/skorch/actions/runs/4436004355/jobs/7783884283#step:6:107

My first guess would be that it's caused by a new neptune version. The installed version is neptune-client-1.0.2. It seems this PR might fix the issue, is that right?

@kshitij12345 kshitij12345 marked this pull request as ready for review March 16, 2023 10:43
@kshitij12345
Copy link
Contributor Author

Yes, this is due to new version and this PR should fix the issue.

@BenjaminBossan
Copy link
Collaborator

Great, thanks for letting me know. I don't want to rush this PR, but since CI is currently broken, do you think it will be done soon? Else, I would restrict the neptune version to make CI pass again.

@kshitij12345
Copy link
Contributor Author

I think the PR is ready. @AleksanderWWW for a final review.

Thank you!

Copy link
Contributor

@AleksanderWWW AleksanderWWW left a comment

Choose a reason for hiding this comment

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

LGTM @kshitij12345 :) The updated imports should resolve the CI issue

@kshitij12345
Copy link
Contributor Author

@BenjaminBossan this should be ready for your review and merging :)

Copy link
Collaborator

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the update. Very nice results on Neptune.

Overall, this is almost good to go, just a few comments, please take a look.

>>> import neptune.new as neptune
>>> from neptune.new.types import File
>>> import neptune
>>> from neptune.types import File
Copy link
Collaborator

Choose a reason for hiding this comment

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

I checked the example and found an issue which was already there before but should still be fixed:

- neptune_logger.run["checkpoints].upload_files("./checkpoints")
+ neptune_logger.run["checkpoints"].upload_files("./checkpoints") 

Also, a few lines that start with ... should be >>>.

Comment on lines +238 to +241
try: # >1.0 package structure
from neptune.handler import Handler
except ImportError: # <1.0 package structure
from neptune.new.handler import Handler
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is all the code compatible with older versions? E.g. the use of append instead of log. If not, there is no point in having this check.

I think it's fine to tell users to install the latest version of neptune (except if you know that users are reluctant to upgrade versions). E.g. when this class is initialized, there could be a version check and a helpful error message when the version is too low. WDYT?

from neptune.new.handler import Handler

root_obj = self.run
if isinstance(self.run, Handler):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you please add a comment here? What is the Handler and why do we sometimes get a Handler and sometimes a Run?

Copy link
Collaborator

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Thanks a lot for keeping the Neptune logger up to date and improving the docs.

@BenjaminBossan BenjaminBossan merged commit e500dd4 into skorch-dev:master Mar 17, 2023
BenjaminBossan pushed a commit that referenced this pull request Mar 17, 2023
Co-authored-by: Sabine <sabine.nyholm@neptune.ai>
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.

5 participants