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

Feat (brevitas_examples/llm): remove dependencies from optimum-amd #1094

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

Giuseppe5
Copy link
Collaborator

@Giuseppe5 Giuseppe5 commented Nov 16, 2024

Reason for this PR

Remove circular dependencies between brevitas and optimum-amd

Changes Made in this PR

Brevitas now implements all the functions required for the LLM entrypoint.

Testing Summary

Risk Highlight

  • This PR includes code from another work (please detail).
  • This PR contains API-breaking changes.
  • This PR depends on work in another PR (please provide links/details).
  • This PR introduces new dependencies (please detail).
  • There are coverage gaps not covered by tests.
  • Documentation updates required in subsequent PR.

Checklist

  • Code comments added to any hard-to-understand areas, if applicable.
  • Changes generate no new warnings.
  • Updated any relevant tests, if applicable.
  • No conflicts with destination dev branch.
  • I reviewed my own code changes.
  • Initial CI/CD passing.
  • 1+ reviews given, and any review issues addressed and approved.
  • Post-review full CI/CD passing.

@Giuseppe5 Giuseppe5 requested review from nickfraser and removed request for nickfraser November 18, 2024 08:22
from .data import get_wikitext2


class DatasetToDevice(torch.utils.data.Dataset):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Lic.



@torch.no_grad()
def recursive_to_device(tensor_or_iterable: Union[Iterable, torch.Tensor], device) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Lic.

src/brevitas_examples/llm/llm_quant/eval.py Outdated Show resolved Hide resolved


@torch.no_grad()
def compute_perplexity(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Lic.

@@ -16,6 +16,10 @@
limitations under the License.
"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Old licence still necessary? Seems the entire contents of this file have changed...

data_files={"validation": "en/c4-validation.00000-of-00008.json.gz"},
)

if fuse_sequences:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this part as well.

@nickfraser
Copy link
Collaborator

Please also remove optimum-amd from requirements-llm.txt & from noxfile.py as well.

Copy link
Collaborator

@nickfraser nickfraser left a comment

Choose a reason for hiding this comment

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

Remove single unused import. I think the rest are required.

accelerate
datasets
onnx
onnx-tools
Copy link
Collaborator

@nickfraser nickfraser Nov 20, 2024

Choose a reason for hiding this comment

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

onnx-tools not required?

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