Skip to content

Add the initial capability to checkpoint partial server state - #3915

Merged
ajpotts merged 1 commit into
Bears-R-Us:masterfrom
e-kayrakli:ak-checkpoint
Feb 14, 2025
Merged

ajpotts merged 1 commit into
Bears-R-Us:masterfrom
e-kayrakli:ak-checkpoint

Conversation

@e-kayrakli

@e-kayrakli e-kayrakli commented Nov 29, 2024 •

Copy link
Copy Markdown
Contributor

This PR adds the ability to checkpoint pdarrays on the server side. Core of this implementation is from @bmcdonald3.

Two client-side functions are added:

  • arkouda.save_checkpoint(name='', path='.akdata')
    • path is the directory to store the save instance. It will be created if it doesn't exist.
    • name is the name of the save instance, by default this will be the server id
  • arkouda.load_checkpoint(name)
    • loads the checkpoint with the given name

TODO

  • handle merge conflicts
  • add test
  • test with large number of nodes and arrays

Comment thread arkouda/io.py Resolved
Comment thread arkouda/pdarrayclass.py Resolved
Comment thread registration-config.json Resolved
Comment thread src/CheckpointMsg.chpl Resolved
Comment thread src/ParquetMsg.chpl Resolved
Comment thread src/CheckpointMsg.chpl Resolved
Comment thread src/CheckpointMsg.chpl Resolved
@ajpotts

ajpotts commented Dec 9, 2024

Copy link
Copy Markdown
Contributor

Thanks for putting this up! It looks great. I noted some comments as I was looking over it. Really looking forward to this new feature!

@e-kayrakli

Copy link
Copy Markdown
Contributor Author

@ajpotts -- I took another focused look at this and I think it is ready for another round of review. I believe I've addressed all your concerns and tested enough. Based on how you feel about it I am ready for it to be merged, but happy to address any other feedback. At a high-level, things happened since your first review:

  • Added a mode argument to save_checkpoint: This controls whether an existing checkpoint should be overridden, or that should cause an error.
  • Converted all metadata into JSON format
    • Added a ArkoudaJSONCompat module to be able to use relatively new features in the standard JSON module
  • Added LoadCheckpointError and SaveCheckpointError types. They are thrown from several places where a checkpointing logic error occurred. Note that other IO etc errors can be propagated, too. IOW, checkpointing doesn't consume other errors to throw just these two errors.
    • There are no assert s or try! in the Chapel code as a result.
  • Added some more cpLogger output for debugging purposes.
  • writeDistArrayToParquet now also returns file sizes. This is necessary for us to be able to load distributed arrays that were checkpointed. I think that's something we can improve upon -- when reading Parquet, we need to pass sizes of each file to be read. In fact, these numbers can be calculated based on the destination arrays distribution. That could be done via an additional helper in the parquet interface, but not high priority.
  • Beefed up the test to check some error conditions. These new tests generate "fake" checkpoints that have some sort of fault in them and asks the server to load to check the error message.
  • I tested this on 8 locales with 8G of data.

@e-kayrakli
e-kayrakli requested a review from ajpotts February 6, 2025 00:35
@e-kayrakli
e-kayrakli force-pushed the ak-checkpoint branch 2 times, most recently from 42170ea to 0ec619c Compare February 8, 2025 01:32
@e-kayrakli

Copy link
Copy Markdown
Contributor Author

I fixed another issue, rebased on master. CI passed in an earlier run, I expect this one to pass.

@ajpotts
ajpotts requested a review from 1RyanK February 11, 2025 17:15

@1RyanK 1RyanK left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems to work as expected (though I am also running 2.3)

Comment thread arkouda/io.py Resolved
Comment thread arkouda/io.py Resolved
Comment thread arkouda/io.py Resolved
Comment thread tests/checkpoint_test.py Resolved
Comment thread arkouda/io.py Resolved
Comment thread tests/checkpoint_test.py Resolved

@ajpotts ajpotts left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. I like all the improvements!

@jaketrookman jaketrookman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good and will be ready to be merged once the flake8 issues are fixed

@e-kayrakli
e-kayrakli force-pushed the ak-checkpoint branch 2 times, most recently from 7b6917d to b7e7ca8 Compare February 14, 2025 17:31
@ajpotts
ajpotts added this pull request to the merge queue Feb 14, 2025
Merged via the queue into Bears-R-Us:master with commit fa83336 Feb 14, 2025
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