ReturnnTrainingJob, support JAX checkpoints - #662
Conversation
|
should we create a JaxCheckpoint helper class similar to Checkpion/PtCheckpoint ? (I also think those checkpoints should have a common base class Checkpoint -> {Tf,Pt,Jax}Checkpoint, but that is a different efactor) |
I didn't needed that indirection. I'm also not sure how e.g. |
|
I think it was introduced for TF for the purpose of loading a model in returnn. A TF checkpoint consists of multiple files (Graph, weights, index I waguely remember) and returnn expects/expected the common filename without extension to load it. But this filename prefix does not correspond to a physical file on disk, so defining a tk.Path object for it would lead to "Job is not runnable" errors. Hence The Checkpoint class. PtCheckpoint really wasn't necessary and was introduced for symmetry I guess. Nowadays we use it to distinguish the checkpoints.. e.g. But of course there are other ways to distinguish those. For Jax, I guess a tk.Path pointing to a folder that exists would be valid and work. |
I don't exactly remember the history, but this is not true since a long time. The TF checkpoint points to @property
def ckpt_path(self):
return self.index_path.get_path()[: -len(".index")]
def __str__(self):
return self.ckpt_path
def __repr__(self):
return "'%s'" % self.ckpt_pathAnd the weird/ugly earlier Which was always weird to me, because you simply could just directly have So, to summarize, I think there never really was any valid reason to have this |
Probably.. I did assume it must be this way until now xD |
No description provided.