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

Llm phi #979

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open

Llm phi #979

wants to merge 13 commits into from

Conversation

porteratzo
Copy link
Collaborator

A jupyter notebook to demo finetuning with the Phi3 LLM model. https://huggingface.co/docs/transformers/main/en/model_doc/phi3

We use the math_10k dataset https://github.com/AGI-Edgerunners/LLM-Adapters/tree/main

We download the dataset from github and check its hash and preprocess the dataset.

We load the phi model and prepare it for PEFT training.

Then we create a workflow that extracts the peft parameters and excludes sending the full model to the collaborators, the collaborators reconstruct the model from the original model and only modify the peft parameters. And after training and evaluation return the peft parameters again to be used with fed average.

@rahulga1
Copy link
Collaborator

@porteratzo can you take care of failed pipelines and ask for review agian?

"outputs": [],
"source": [
"!pip install git+https://github.com/intel/openfl.git\n",
"!cd /home/oamontoy/workspace/openfl/openfl-tutorials/experimental/Phi3 && pip install -r ../requirements_workflow_interface.txt\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you remove the absolute path and. keep general like
!pip install git+https://github.com/securefederatedai/openfl.git
!pip install -r workflow_interface_requirements.txt

"!pip install git+https://github.com/intel/openfl.git\n",
"!cd /home/oamontoy/workspace/openfl/openfl-tutorials/experimental/Phi3 && pip install -r ../requirements_workflow_interface.txt\n",
"!pip install numpy --upgrade\n",
"!pip install transformers peft datasets trl"
Copy link
Collaborator

@rajithkrishnegowda rajithkrishnegowda Dec 27, 2024

Choose a reason for hiding this comment

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

when running "!pip install datasets trl" getting the below error

      -- Running cmake for PyArrow
      cmake -DCMAKE_INSTALL_PREFIX=/private/var/folders/bj/xlf52n2s7zx24gvllky2f_wh0000gn/T/pip-install-55o676u7/pyarrow_50ccfaecb1b946ff8ad649bdf24d7546/build/lib.macosx-10.9-x86_64-cpython-311/pyarrow -DPYTHON_EXECUTABLE=/Users/rkrishne/anaconda3/bin/python -DPython3_EXECUTABLE=/Users/rkrishne/anaconda3/bin/python -DPYARROW_CXXFLAGS= -DPYARROW_BUNDLE_ARROW_CPP=off -DPYARROW_BUNDLE_CYTHON_CPP=off -DPYARROW_GENERATE_COVERAGE=off -DCMAKE_BUILD_TYPE=release /private/var/folders/bj/xlf52n2s7zx24gvllky2f_wh0000gn/T/pip-install-55o676u7/pyarrow_50ccfaecb1b946ff8ad649bdf24d7546
      error: command 'cmake' failed: No such file or directory
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyarrow
Failed to build pyarrow
ERROR: Could not build wheels for pyarrow, which is required to install pyproject.toml-based projects

Copy link
Collaborator

@rajithkrishnegowda rajithkrishnegowda Dec 27, 2024

Choose a reason for hiding this comment

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

to resolve tat error we need to install cmake package but even after installing cmake package getting the below error

/private/var/folders/bj/xlf52n2s7zx24gvllky2f_wh0000gn/T/pip-install-doldjp2l/pyarrow_53bf7158da274fff8d32761768c8e19b/pyarrow/src/arrow/python/arrow_to_pandas.cc:208:16:` error: no member named 'LARGE_LIST_VIEW' in 'arrow::Type'; did you mean 'LARGE_LIST'?
          case Type::LARGE_LIST_VIEW: {
               ~~~~~~^~~~~~~~~~~~~~~
                     LARGE_LIST
      /anaconda3/include/arrow/type_fwd.h:410:5: note: 'LARGE_LIST' declared here
          LARGE_LIST = 36,
          ^
      fatal error: too many errors emitted, stopping now [-ferror-limit=]
      20 errors generated.
      make[2]: *** [CMakeFiles/arrow_python.dir/pyarrow/src/arrow/python/arrow_to_pandas.cc.o] Error 1
      make[1]: *** [CMakeFiles/arrow_python.dir/all] Error 2
      make: *** [all] Error 2
      error: command '/usr/local/bin/cmake' failed with exit code 2
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyarrow
Failed to build pyarrow
ERROR: Could not build wheels for pyarrow, which is required to install pyproject.toml-based projects
Note: you may need to restart the kernel to use updated packages.

Copy link
Collaborator Author

@porteratzo porteratzo Jan 6, 2025

Choose a reason for hiding this comment

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

I am unable to replicate the error, tested with a fresh python3.10 env using conda, also used --no-cache to make sure packages where being downloaded

Copy link
Collaborator

Choose a reason for hiding this comment

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

I tired with python 3.10 version and was able to install without any error. But when i tired with python 3.11 version then we get the above issue.

We have to specify somewhere as a prerequisites that it only works with python 3.10.

porteratzo and others added 12 commits January 6, 2025 12:44
Signed-off-by: porteratzo <[email protected]>
Signed-off-by: porteratzo <[email protected]>
Signed-off-by: porteratzo <[email protected]>
Signed-off-by: porteratzo <[email protected]>
Signed-off-by: porteratzo <[email protected]>
Signed-off-by: porteratzo <[email protected]>
Signed-off-by: porteratzo <[email protected]>
* Replace xml.etree.ElementTree.parse with its defusedxml

Signed-off-by: Chaurasiya, Payal <[email protected]>

* convert to json

Signed-off-by: Chaurasiya, Payal <[email protected]>

* Fix memory logs and create pdf

Signed-off-by: Chaurasiya, Payal <[email protected]>

---------

Signed-off-by: Chaurasiya, Payal <[email protected]>
Signed-off-by: porteratzo <[email protected]>
)

* Create openfl-docker-build.yml
* remove test event

Signed-off-by: porteratzo <[email protected]>
Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.25.0 to 0.25.1.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Commits](pytest-dev/pytest-asyncio@v0.25.0...v0.25.1)

---
updated-dependencies:
- dependency-name: pytest-asyncio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Signed-off-by: porteratzo <[email protected]>
@rahulga1
Copy link
Collaborator

@psfoley should we direct this PR to openFL-contrib instead?

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.

6 participants