Skip to content

Conversation

@ufownl
Copy link
Contributor

@ufownl ufownl commented Aug 10, 2024

Refs #338

I noticed that the original padding code is not used, and the current implementation truncates the prompts to align to the shortest length to avoid accessing out-of-range. So before calling the batch interface, users should insert <pad> tokens in the front of the prompts to align them to the maximum length.

Copy link
Member

@jan-wassenberg jan-wassenberg left a comment

Choose a reason for hiding this comment

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

Very nice, I like that you also used a typedef. Looks good.

Good catch that prompt() is unused. We do have some internal code that uses it, though. Would you mind reverting that change? We can then redo the removal once it's no longer referenced.

size_t& min_prompt_size,
size_t& max_prompt_size) {
// Count the minimum/maximum size of prompts for interleave queries.
static void InterleaveQueries(const MultiplePromptsTokens& queries,
Copy link
Member

Choose a reason for hiding this comment

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

Please keep the std::vector return for now until we can remove the last reference to it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, let me drop that commit. :)

@ufownl ufownl force-pushed the feature/start_pos_per_query branch from f3ef9f6 to 7823829 Compare August 12, 2024 11:50
@ufownl
Copy link
Contributor Author

ufownl commented Aug 12, 2024

I've dropped that commit. :)

@ufownl ufownl force-pushed the feature/start_pos_per_query branch from 7823829 to e02b1e9 Compare August 12, 2024 11:55
Copy link
Member

@jan-wassenberg jan-wassenberg left a comment

Choose a reason for hiding this comment

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

Thanks :)

@jan-wassenberg jan-wassenberg added the copybara-import Trigger Copybara for merging pull requests label Aug 12, 2024
@jan-wassenberg
Copy link
Member

hm, we seem to have change markers (<<<<<) inside the argument list of TransformerLayer in gemma-inl.h, not in the pull request but in the code that copybara imported. Maybe the force-push clobbered history? Can you rebase and double-check the diff is clean? Worst case, create a new pull request?

@ufownl
Copy link
Contributor Author

ufownl commented Aug 12, 2024

OK, let me have a see.

@ufownl
Copy link
Contributor Author

ufownl commented Aug 12, 2024

I saw the newest commit of the dev branch was just added some test cases about gemma2 and small fixes, there shouldn't be any conflict in gemma-inl.h? I have rebased my local branch to the newest dev branch, and there was no conflict. Is the latest code not in the dev branch?

@jan-wassenberg
Copy link
Member

I agree there isn't actually a conflict, I think the issue is just that the branch is out of date. A git pull -r followed by a push should fix it :)

@ufownl ufownl force-pushed the feature/start_pos_per_query branch from e02b1e9 to 5c98189 Compare August 12, 2024 15:30
@ufownl
Copy link
Contributor Author

ufownl commented Aug 12, 2024

I've updated this branch. See if the problem still exists?

@jan-wassenberg jan-wassenberg added copybara-import Trigger Copybara for merging pull requests and removed copybara-import Trigger Copybara for merging pull requests labels Aug 12, 2024
@jan-wassenberg
Copy link
Member

Thanks, rerunning the import :)

@jan-wassenberg
Copy link
Member

Sorry, still seeing the conflict :( Would you mind re-creating the pull request?

@ufownl
Copy link
Contributor Author

ufownl commented Aug 12, 2024

OK, I close this PR first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copybara-import Trigger Copybara for merging pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants