Fix sampler_weights checkpoint loading#31
Open
Jah-yee wants to merge 1 commit intothinking-machines-lab:mainfrom
Open
Fix sampler_weights checkpoint loading#31Jah-yee wants to merge 1 commit intothinking-machines-lab:mainfrom
Jah-yee wants to merge 1 commit intothinking-machines-lab:mainfrom
Conversation
- Add api_checkpoint_id property to ParsedCheckpointTinkerPath that returns the correct checkpoint_id format for API calls (includes 'sampler_weights/' prefix for sampler checkpoints) - Update rest_client methods to use api_checkpoint_id instead of checkpoint_id - Add tests for sampler_weights path parsing and API checkpoint ID format Fixes Issue thinking-machines-lab#25: sampler_weights not available while weights is available
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes Issue #25:
sampler_weightsnot available whileweightsis availableProblem
When loading a
sampler_weightscheckpoint using a tinker path (e.g.,tinker://run-id/sampler_weights/0001), the checkpoint loading fails with a "Path is invalid" error. This happens because the API call was being made with an incorrectly formatted checkpoint ID.Root Cause
In
ParsedCheckpointTinkerPath.from_tinker_path(), thecheckpoint_idwas being set to include the type prefix (e.g.,sampler_weights/0001), but the API was receiving inconsistent checkpoint ID formats that didn't properly distinguish between training and sampler checkpoints.Fix
Added a new
api_checkpoint_idproperty toParsedCheckpointTinkerPaththat returns:0001)sampler_weights/0001)Updated all methods that use tinker paths in
rest_client.pyto useapi_checkpoint_idinstead ofcheckpoint_idTesting
Added new test file
tests/test_sampler_weights_loading.pywith tests for:api_checkpoint_idformat is returned for each typeHow to Test
training_client.save_weights_for_sampler("sampler-001")tinker://run-id/sampler_weights/sampler-001)rest_client.get_checkpoint_archive_url_from_tinker_path(tinker_path)The fix ensures both
weightsandsampler_weightscheckpoints can be loaded without errors.