Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated storage and training files to enable text generation tasks. A… #640

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sjohn4
Copy link

@sjohn4 sjohn4 commented Dec 11, 2024

Made minor updates to the environment and ensured everything passes the standard Python compliance tests, maintaining compatibility with Modyn's existing functionality. Added GPT-2 as a model that can be used along with the GPT-2 tokenizer. Introduced the generative flag to the Modyn pipeline, enabling it to distinguish between generative and classification tasks. Also updated some Python test files to incorporate this flag, ensuring no errors are thrown.

…dditionally, made minor updates to the environment and ensured everything passes the standard Python compliance tests, maintaining compatibility with Modyn's existing functionality.
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 27.29592% with 570 lines in your changes missing coverage. Please review.

Project coverage is 81.72%. Comparing base (b63795f) to head (c08b24e).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
modyn/models/GPT2/GPT2_Model_LoRA.py 17.09% 417 Missing ⚠️
.../trainer_server/internal/dataset/online_dataset.py 46.45% 83 Missing ⚠️
modyn/models/GPT2/GPT2.py 33.73% 55 Missing ⚠️
modyn/models/tokenizers/gpt2_tokenizer.py 38.46% 8 Missing ⚠️
...trainer_server/internal/trainer/pytorch_trainer.py 73.07% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #640      +/-   ##
==========================================
- Coverage   85.58%   81.72%   -3.86%     
==========================================
  Files         258      261       +3     
  Lines       11377    12089     +712     
==========================================
+ Hits         9737     9880     +143     
- Misses       1640     2209     +569     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@MaxiBoether MaxiBoether left a comment

Choose a reason for hiding this comment

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

I briefly skimmed the PR. Thanks for the work! The biggest feedback right now would be that we should not have parallel codepaths which are mostly copy/paste of existing ones but without labels. Rather, let's have clean code where we move labels to be optional, both in the c++/protobuf/python worlds. And before I do the proper review, would be great if you could check the diff for changes that should not go onto main :)

Thanks!

@@ -30,7 +30,7 @@ dependencies:
- psycopg2
- sqlalchemy>=2.0
- pyaml
- pydantic
- pydantic==2.9.2
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be solved with the latest commit on main

Comment on lines -48 to +52
# - nvidia::cuda-libraries-dev=12.1.*
# - nvidia::cuda-nvcc=12.1.*
# - nvidia::cuda-nvtx=12.1.*
# - nvidia::cuda-cupti=12.1.*
# - nvidia::cuda-cudart-dev=12.1.*
# - nvidia::cuda-profiler-api=12.1.*
- pytorch::pytorch-cuda=12.1
- nvidia::cuda-libraries-dev=12.1.*
- nvidia::cuda-nvcc=12.1.*
- nvidia::cuda-nvtx=12.1.*
- nvidia::cuda-cupti=12.1.*
- nvidia::cuda-cudart-dev=12.1.*
- nvidia::cuda-profiler-api==12.1.*
Copy link
Contributor

Choose a reason for hiding this comment

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

should be commented out. no changes here should be necessary

ignore_existing_trigger_samples: false
ignore_existing_trigger_samples: true
Copy link
Contributor

Choose a reason for hiding this comment

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

let's not merge this

@@ -255,7 +255,7 @@ class SelectorConfig(HostnamePortMixin):
),
)
ignore_existing_trigger_samples: bool = Field(
False,
Copy link
Contributor

Choose a reason for hiding this comment

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

also shouldnt merge that

@@ -0,0 +1,365 @@
#plimport pytorch_lightning as pl
Copy link
Contributor

Choose a reason for hiding this comment

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

this file needs to be cleaned before merging it. remove all unnecessary comments. there should only be necessary functions, e.g. there should not need to be the need for evaluation code in here

@@ -0,0 +1,152 @@
//""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Copy link
Contributor

Choose a reason for hiding this comment

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

draft file?

Comment on lines 75 to +77
Status Get(ServerContext* context, const modyn::storage::GetRequest* request,
ServerWriter<modyn::storage::GetResponse>* writer) override;
Status GetNL(ServerContext* context, const modyn::storage::GetRequest* request,
Copy link
Contributor

Choose a reason for hiding this comment

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

similar to my comment on the proto file, let's not introduce second codepaths as much as possible, because this seems to replicate a lot of logic. rather, let's add labels if we have them in the orgiinal code path

@@ -74,6 +74,8 @@ class StorageServiceImpl final : public modyn::storage::Storage::Service {

Status Get(ServerContext* context, const modyn::storage::GetRequest* request,
ServerWriter<modyn::storage::GetResponse>* writer) override;
Status GetNL(ServerContext* context, const modyn::storage::GetRequest* request,
ServerWriter<modyn::storage::GetResponseNoLabels>* writer) override;
Copy link
Contributor

Choose a reason for hiding this comment

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

also i think this file in general needs to be cleaned

@@ -409,8 +626,45 @@ def _fetch_partition_noprefetch(
container["weights"][idx],
)

def _fetch_partition_noprefetch_generative( # based on the one above
Copy link
Contributor

Choose a reason for hiding this comment

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

similar comments here. I would propose to refactor the PR such that we don't have parallel codepaths for generative

@@ -57,7 +57,8 @@ def __init__(

self.shuffle = request.shuffle
self.enable_accurate_gpu_measurements = request.enable_accurate_gpu_measurements

self.generative=request.generative
print(f"generetive:{self.generative}")
Copy link
Contributor

Choose a reason for hiding this comment

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

debug logs

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.

2 participants