broccoli-ml 1.2.0__py3-none-any.whl → 1.2.1__py3-none-any.whl

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.
broccoli/transformer.py CHANGED
@@ -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
  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
@@ -8,10 +8,10 @@ broccoli/eigenpatches.py,sha256=J6n2usN1oQuHEHYiBNyYpn_a9eQcHjOBiIlvSei520Y,2413
8
8
  broccoli/linear.py,sha256=w021EDzWVDEu9odzrf9QwBZ3G8Ydu3nroV8soIJeRng,4894
9
9
  broccoli/rope.py,sha256=hw7kBPNR9GQXj4GxyIAffsGKPfcTPOFh8Bc7oEHtaZY,12108
10
10
  broccoli/tensor.py,sha256=um8mrxkYbvNDo-QvHlmJm8Aw6qcngOlUZPoAk_PMReA,4480
11
- broccoli/transformer.py,sha256=KhwrV5Nz0utXJQKFFf6MIifmymgOaylc_2_hs9kQt7g,18455
11
+ broccoli/transformer.py,sha256=Dx8X4L5YExaXShvx9pDnUNy9sf8rW_LHuh1spKVIK90,18539
12
12
  broccoli/utils.py,sha256=htq_hOsdhUhL0nJi9WkKiEYOjEoWqFpK5X49PtgTf-0,299
13
13
  broccoli/vit.py,sha256=9dfOPO7y-o96OYpy_ancH4-Y2_Y62fqgzJvI3-86W_o,18471
14
- broccoli_ml-1.2.0.dist-info/LICENSE,sha256=0BAzJE5BqQ7Iixp_AFdB2W1uO-HCRX-Qfun8PHt6yVM,1073
15
- broccoli_ml-1.2.0.dist-info/METADATA,sha256=am67vHH2HDQdq3G336ng56xX6-ys1LyZzLRIWaf8dE8,1256
16
- broccoli_ml-1.2.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
17
- broccoli_ml-1.2.0.dist-info/RECORD,,
14
+ broccoli_ml-1.2.1.dist-info/LICENSE,sha256=0BAzJE5BqQ7Iixp_AFdB2W1uO-HCRX-Qfun8PHt6yVM,1073
15
+ broccoli_ml-1.2.1.dist-info/METADATA,sha256=2TpRTbTMOY3CiNKiC1_t1d9oWEf_Dp3dOUEJ913Pfe0,1256
16
+ broccoli_ml-1.2.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
17
+ broccoli_ml-1.2.1.dist-info/RECORD,,