broccoli-ml 1.2.0__tar.gz → 1.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: broccoli-ml
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: Some useful Pytorch models, circa 2025
5
5
  License: MIT
6
6
  Author: Nicholas Bailey
@@ -219,7 +219,8 @@ class MHAttention(nn.Module):
219
219
  if self.scaling == "sqrtd":
220
220
  qk_scores /= math.sqrt(self.head_dim)
221
221
  elif self.scaling == "d":
222
- qk_scores /= self.head_dim
222
+ # for backwards compatibility, per https://github.com/microsoft/mup
223
+ qk_scores *= 8 / self.head_dim
223
224
  else:
224
225
  raise ValueError('`scaling` argument to MHAttention must be "d" or "sqrtd"')
225
226
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "broccoli-ml"
3
- version = "1.2.0"
3
+ version = "1.2.1"
4
4
  description = "Some useful Pytorch models, circa 2025"
5
5
  authors = [
6
6
  {name = "Nicholas Bailey"}
File without changes
File without changes
File without changes
File without changes