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

likely fix for strange error with gcc <= 9 #1

Closed
wants to merge 1 commit into from
Closed

Conversation

xloem
Copy link

@xloem xloem commented Jun 25, 2022

I have gcc 9 and the code wouldn't compile due to a different gelu() function interface; a bool parameter is passed for gcc <= 9.

I checked the torch source and saw a new parameter was added to gelu() in torch 12 (currently looks almost through release candidates, can be installed from the nightlies with something like pip3 install --pre torch\<1.13 --extra-index-url https://download.pytorch.org/whl/nightly/cu113). It was documented in the commit logs as a boolean for approximation, but it appears to be a string in the actual source.

I'm guessing this slipped by tests because gcc > 9 was used for testing.

I mutated the check to check for torch >= 1.12 instead, and change the boolean true to a string "tanh" which I think is what torch 12 expects.

The code sequence seems very strange, and I'm curious if it was made by some AI refactoring tool. I don't use one, so I'm always looking to learn if there's a good one.

@daskol
Copy link
Member

daskol commented Dec 3, 2022

Thanks. This is known issue. It is fixed in the other branch. It will be merged to main.

@daskol daskol closed this Dec 3, 2022
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.

None yet

2 participants