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

[Enhancement] Allow Bert Encoder to specify hidden dime for the fc layers #104

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

Conversation

842974287
Copy link
Contributor

This was the second enhancement in #98.

Add support for different hidden dimension size in bert's fc layers. Currently in bert encoder feed forward part, the hidden dim of the first fc is hardcoded to 4 * head_dim * head_size. This PR added a field to pass in the size of hidden dimension.

@842974287
Copy link
Contributor Author

@byshiue Hey, I added some fixes, could you please take a look again? Thanks!

@byshiue
Copy link
Collaborator

byshiue commented Jul 7, 2021

Have you compiled the codes to verify the correctness?
We find that the pull request of last comment cannot be compiled successfully.

@842974287
Copy link
Contributor Author

Really sorry about the inconvenience. I can't really run the tensorflow unit tests due to some constraints. I tried running encoder_sample.cc but hit an error at this line saying

<jemalloc>: size mismatch detected (true size 32768 vs input size 8), likely caused by application sized dealloction bugs (source address: 0x7ffab28eb000, the current pointer being freed). Suggest building with --enable-debug or address sanitizer for debugging. Abort.

@byshiue
Copy link
Collaborator

byshiue commented Jul 7, 2021

I think that original code can work normally.

@byshiue
Copy link
Collaborator

byshiue commented Jul 7, 2021

Besides, I still cannot compile this code successfully on TensorFlow.

@yinghai
Copy link

yinghai commented Jul 8, 2021

@842974287 I think we should try to compile/screen tf code to make sure it works for tf. For example, to avoid fixes like 55c6c69

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.

3 participants