-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
fixed imports, docstrings, removed unneeded tests #129
Conversation
@@ -1,3 +1,7 @@ | |||
""" sky_api module """ | |||
""" This module provides a simplified interface for launching, executing, |
Check warning
Code scanning / Prospector (reported by Codacy)
String statement has no effect (pointless-string-statement) Warning
attention = FlashAttention(causal=False, dropout=0.1, flash=True) | ||
output = attention(q, k, v) | ||
|
||
assert(output.shape == (2, 4, 6, 8)) |
Check notice
Code scanning / Bandit
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note test
attention = FlashAttention(causal=False, dropout=0.1, flash=True) | ||
output = attention(q, k, v) | ||
|
||
assert(output.shape == (2, 4, 6, 8)) |
Check notice
Code scanning / Semgrep (reported by Codacy)
The application was found using assert in non-test code. Note test
attention = FlashAttention(causal=False, dropout=0.1, flash=True) | ||
output = attention(q, k, v) | ||
|
||
assert(output.shape == (2, 4, 6, 8)) |
Check warning
Code scanning / Bandit (reported by Codacy)
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Warning test
@@ -120,6 +122,21 @@ | |||
# Check if flash attention configuration is correct | |||
assert out.shape == (1, 8, 32, 64) | |||
|
|||
# Test case for configuring flash attention | |||
def test_flash_attention(): | |||
import torch |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Import outside toplevel (torch) Warning test
output = attention(q, k, v) | ||
|
||
assert(output.shape == (2, 4, 6, 8)) | ||
|
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Trailing whitespace Warning test
# Test case for configuring flash attention | ||
def test_flash_attention(): | ||
import torch | ||
from zeta.nn import FlashAttention |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Import outside toplevel (zeta.nn.FlashAttention) Warning test
attention = FlashAttention(causal=False, dropout=0.1, flash=True) | ||
output = attention(q, k, v) | ||
|
||
assert(output.shape == (2, 4, 6, 8)) |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Unnecessary parens after 'assert' keyword Warning test
@@ -120,6 +122,21 @@ | |||
# Check if flash attention configuration is correct | |||
assert out.shape == (1, 8, 32, 64) | |||
|
|||
# Test case for configuring flash attention | |||
def test_flash_attention(): |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Missing function or method docstring Warning test
Polishing the apple a bit.
Tests are now fully running again.