ray icon indicating copy to clipboard operation
ray copied to clipboard

[AIR] Framework specific Checkpoint API consistency

Open amogkam opened this issue 2 years ago • 7 comments

We should make sure all of our framework-specific Checkpoints follow similar API design patterns.

  • For creating checkpoints via different sources (for example, from a model object, from a path, etc.), these should be expressed as different methods and not overloaded onto the same method.
  • All framework specific checkpoint classes should expose def get_model(self, *args, **kwargs) and def get_preprocessor(self) -> Optional[Preprocessors] methods. These can be defined in a private abstract base class that all framework specific checkpoint can inherit from.
  • All predictors should interact with framework specific checkpoints through get_model and get_preprocessor APIs.
  • The framework-specific Predictors' from_checkpoint method should accept **get_model_kwargs so users can specify kwargs that should be passed through to checkpoint.get_model(...)

cc @xwjiang2010

amogkam avatar Sep 09 '22 19:09 amogkam

@xwjiang2010 @amogkam @krfricke im happy to take a look at this if this hasn't been grabbed!

heyitsmui avatar Sep 13 '22 16:09 heyitsmui

yeah please do so! and keep us updated. opening a draft PR would be the fastest way to collaborate here!

richardliaw avatar Sep 15 '22 17:09 richardliaw

hey @heyitsmui, let me know if you are still planning to work on this :).

amogkam avatar Sep 20 '22 02:09 amogkam

hey @xwjiang2010 i believe you mentioned you already have a draft PR for this? if not, i can get started on this :)

heyitsmui avatar Sep 20 '22 15:09 heyitsmui

Ah the one I have is this: https://github.com/ray-project/ray/pull/28474 It's currently being blocked by another PR, which should be landed soon. I dont have other parts of this task planned yet.

xwjiang2010 avatar Sep 20 '22 17:09 xwjiang2010

ah thanks @xwjiang2010 for the clarification! i will take a stab at the rest of the tasks planned, on top of your current PR, thanks!

heyitsmui avatar Sep 20 '22 18:09 heyitsmui

Thanks @heyitsmui! Let me know if you have any questions!

amogkam avatar Sep 20 '22 18:09 amogkam

Working on this now, expect to have a draft PR out for review later today

heyitsmui avatar Sep 27 '22 16:09 heyitsmui

awesome!

On Tue, Sep 27, 2022 at 9:06 AM Michael Mui @.***> wrote:

Working on this now, expect to have a draft PR out for review later today

— Reply to this email directly, view it on GitHub https://github.com/ray-project/ray/issues/28412#issuecomment-1259722803, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCRZZIAVIXY76SHKJN7N2DWAMLQJANCNFSM6AAAAAAQI572DQ . You are receiving this because you commented.Message ID: @.***>

richardliaw avatar Sep 27 '22 17:09 richardliaw

@heyitsmui did you create a pr for this?

richardliaw avatar Oct 29 '22 00:10 richardliaw

bump @heyitsmui ?

richardliaw avatar Nov 11 '22 18:11 richardliaw

@richardliaw thanks for checking in, let me clean up my change, will have a PR out for review by tomorrow EOD

heyitsmui avatar Nov 16 '22 19:11 heyitsmui

^^ @heyitsmui :)

richardliaw avatar Feb 09 '23 18:02 richardliaw