Skip to content
This repository was archived by the owner on Apr 23, 2026. It is now read-only.

More efficiently use diskspace - #1012

Merged
mergify[bot] merged 1 commit into
instructlab:mainfrom
derekhiggins:use_less_disk
May 21, 2024
Merged

More efficiently use diskspace#1012
mergify[bot] merged 1 commit into
instructlab:mainfrom
derekhiggins:use_less_disk

Conversation

@derekhiggins

Copy link
Copy Markdown
Contributor

In order to allow ilab to run e2e on colab where diskspace is limited we move rather then copy large files around, also rm files we're done with to save space for the next step.

Fix #1011

@derekhiggins
derekhiggins force-pushed the use_less_disk branch 3 times, most recently from 346387f to 5479f8e Compare April 30, 2024 21:31
@mergify mergify Bot added the testing Relates to testing label Apr 30, 2024
@derekhiggins
derekhiggins force-pushed the use_less_disk branch 2 times, most recently from fd90dbe to 0f3e9e4 Compare April 30, 2024 22:01
Comment thread tests/test_lab_train.py Outdated
linux_train_mock,
is_macos_with_m_chip_mock,
):
# pylint: disable=consider-using-with

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.

nit: you may be able to avoid arguing with the linter about this if you declare a helper function instead of using a lambda?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

thanks, the lambda has been replaced

@derekhiggins derekhiggins changed the title More efficienlty use diskspace More efficiently use diskspace May 9, 2024
Comment thread src/instructlab/lab.py Outdated
Comment on lines +1057 to +1058
if os.path.exists(final_results_dir):
shutil.rmtree(final_results_dir)

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.

I'm a bit uncomfortable blindly removing this whole directory. I'd rather only operate on exactly the files we know are relevant to the current run of ilab and not make assumptions about what can be removed otherwise. I just want to avoid any surprising destructive behavior.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually looking at this again I think I can just remove these two lines. The large model files that it contained is now moved instead of copied so this directory isn't taking up a lot of space.

@mergify mergify Bot added the ci-failure PR has at least one CI failure label May 17, 2024
In order to allow ilab to run e2e on colab where diskspace
is limited we move rather then copy large files around, also
rm files we're done with to save space for the next step.

Fix instructlab#1011

Signed-off-by: Derek Higgins <derekh@redhat.com>
@mergify mergify Bot removed the ci-failure PR has at least one CI failure label May 17, 2024
Comment thread src/instructlab/lab.py
for file in glob(final_results_dir + "/*.safetensors"):
os.remove(file)

shutil.move(final_results_dir + "/ggml-model-f16.gguf", gguf_models_file)

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.

only if you have to make another change anyway, would be good to make this os.path.join(). I know this isn't new code though, so it's not worth blocking over

@mergify mergify Bot added the one-approval PR has one approval from a maintainer label May 20, 2024
@mergify
mergify Bot merged commit 0429bbc into instructlab:main May 21, 2024
@mergify mergify Bot removed the one-approval PR has one approval from a maintainer label May 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

testing Relates to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Training uses up all available disk space in colab

4 participants