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

Pytorch Taskrunner Workspace with Keras 3 #1333

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

tanwarsh
Copy link
Collaborator

@tanwarsh tanwarsh commented Feb 3, 2025

Pytorch Taskrunner Workspace with Keras 3

This PR is blocked due to keras-team/keras#20847.

Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Signed-off-by: yes <[email protected]>
Copy link
Collaborator

@kta-intel kta-intel left a comment

Choose a reason for hiding this comment

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

Thanks @tanwarsh ! Some open ended comments/questions:

  1. We should consider having this one directory down, either under keras/pytorch workspace or under pytorch/keras. This would simply be a way to further indicate that is either (1) an extended functionality of the native keras taskrunner or (2) a special case for pytorch that uses the keras taskrunner.
  2. Is there a reason you decided to go with a customized fit() function as opposed to a custom training loop? This way is not wrong, of course, but the custom training loop seems like a more natural addition to the task runner since a dev would be expected to modify the train_ and validate functions, whereas inheriting keras.Model and then modifying train_step and test_step may be confusing. If we stick to this, I suggest we move the model definition to a separate file then import it in taskrunner.py. Also, even if we stick with this, I think we should also add in the a workspace that takes advantage of the custom training loop (it can be added as backlog item to be added in a separate PR)


compression_pipeline :
defaults : plan/defaults/compression_pipeline.yaml
# To use different Compression Pipeline, uncomment the following lines
Copy link
Collaborator

Choose a reason for hiding this comment

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

We an remove these comments since we have dedicated workspaces / docs for compression pipeline

"""
super().__init__(batch_size, **kwargs)

# TODO: We should be downloading the dataset shard into a directory
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can remove these TODOs and add it as a backlog item. FYI, I don't think it's entirely necessary to download the dataset shard into a directory for the --template workspaces, but automatic sharding based on rank / size of collab list could be interesting


from openfl.federated import KerasTaskRunner

class CNNModel(keras.Model):
Copy link
Collaborator

Choose a reason for hiding this comment

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

from my previous comment, we should move this to a separate file then import it

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