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

Add class that implements BaseCausalLMModel but is backed by an IREE module #393

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sogartar
Copy link
Contributor

@sogartar sogartar commented Oct 31, 2024

The exported IREE LLM models have only prefill/decode that accept sequence lengths, so the default implementations in BaseCausalLMModel must be overridden.

This is meant only for testing. It may not be performant as it marshals tensors and uses the IREE Python bindings.

…odule

This is meant only for testing. It may not be performant as it
marshals tensors and uses the IREE Python bindings.
@sogartar
Copy link
Contributor Author

This PR depends on #383.

@@ -43,3 +53,106 @@ def make_llama_attention_block_theta(
),
}
)


class CausalLMIreeModel(BaseCausalLMModel, CausalLMModelABC):
Copy link
Contributor

Choose a reason for hiding this comment

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

Dependent on the double inheritance PR you have. This should have a cleaner design rather than extend with double inheritance.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed CausalLMModelABC.

@sogartar sogartar changed the title Add class that implements CausalLMModelABC but is backed by an IREE module Add class that implements prefill/decode from seq lens but is backed by an IREE module Nov 7, 2024
@sogartar sogartar changed the title Add class that implements prefill/decode from seq lens but is backed by an IREE module Add class that implements BaseCausalLMModel but is backed by an IREE module Nov 7, 2024
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