optimum-rbln 0.9.2a5__py3-none-any.whl → 0.9.2a7__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.

Potentially problematic release.


This version of optimum-rbln might be problematic. Click here for more details.

@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.9.2a5'
32
- __version_tuple__ = version_tuple = (0, 9, 2, 'a5')
31
+ __version__ = version = '0.9.2a7'
32
+ __version_tuple__ = version_tuple = (0, 9, 2, 'a7')
33
33
 
34
34
  __commit_id__ = commit_id = None
optimum/rbln/modeling.py CHANGED
@@ -249,37 +249,11 @@ class RBLNModel(RBLNBaseModel):
249
249
  trust_remote_code: bool = False,
250
250
  # Some rbln-config should be applied before loading torch module (i.e. quantized llm)
251
251
  rbln_config: Optional[RBLNModelConfig] = None,
252
- dtype: Optional[Union[str, torch.dtype, dict]] = None,
253
252
  **kwargs,
254
253
  ) -> "PreTrainedModel":
255
254
  kwargs = cls.update_kwargs(kwargs)
256
255
 
257
- hf_class = cls.get_hf_class()
258
-
259
- if dtype is not None:
260
- config = hf_class.config_class.from_pretrained(
261
- model_id,
262
- subfolder=subfolder,
263
- revision=revision,
264
- cache_dir=cache_dir,
265
- use_auth_token=use_auth_token,
266
- local_files_only=local_files_only,
267
- force_download=force_download,
268
- trust_remote_code=trust_remote_code,
269
- )
270
-
271
- config, processed_dtype, dtype_orig = _get_dtype(
272
- cls=hf_class,
273
- dtype=dtype,
274
- config=config,
275
- )
276
-
277
- kwargs["torch_dtype"] = processed_dtype
278
-
279
- if dtype_orig is not None:
280
- hf_class._set_default_dtype(dtype_orig)
281
-
282
- return hf_class.from_pretrained(
256
+ return cls.get_hf_class().from_pretrained(
283
257
  model_id,
284
258
  subfolder=subfolder,
285
259
  revision=revision,
@@ -322,22 +322,30 @@ class RBLNDecoderOnlyModel(RBLNModel, RBLNDecoderOnlyFlashAttentionMixin):
322
322
  *args,
323
323
  rbln_config: Optional[RBLNDecoderOnlyModelConfig] = None,
324
324
  num_hidden_layers: Optional[int] = None,
325
+ trust_remote_code: Optional[bool] = None,
326
+ torch_dtype: Optional[torch.dtype] = None,
327
+ dtype: Optional[torch.dtype] = None,
325
328
  **kwargs,
326
329
  ) -> PreTrainedModel:
327
330
  if rbln_config and rbln_config.quantization:
328
331
  model = cls.get_quantized_model(model_id, *args, rbln_config=rbln_config, **kwargs)
329
332
  else:
333
+ # TODO : resolve how to control PreTrainedConfig for hf_kwargs
330
334
  if num_hidden_layers is not None:
331
- trust_remote_code = kwargs.get("trust_remote_code", None)
332
335
  config, kwargs = AutoConfig.from_pretrained(
333
- model_id, return_unused_kwargs=True, num_hidden_layers=num_hidden_layers, **kwargs
336
+ model_id,
337
+ return_unused_kwargs=True,
338
+ trust_remote_code=trust_remote_code,
339
+ num_hidden_layers=num_hidden_layers,
340
+ **kwargs,
334
341
  )
335
342
  if hasattr(config, "layer_types"):
336
343
  config.layer_types = config.layer_types[:num_hidden_layers]
337
344
  kwargs["config"] = config
338
- kwargs["trust_remote_code"] = trust_remote_code
339
345
 
340
- model = super().get_pytorch_model(model_id, *args, **kwargs)
346
+ model = super().get_pytorch_model(
347
+ model_id, *args, trust_remote_code=trust_remote_code, torch_dtype=torch_dtype, dtype=dtype, **kwargs
348
+ )
341
349
 
342
350
  return model
343
351
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: optimum-rbln
3
- Version: 0.9.2a5
3
+ Version: 0.9.2a7
4
4
  Summary: Optimum RBLN is the interface between the HuggingFace Transformers and Diffusers libraries and RBLN accelerators. It provides a set of tools enabling easy model loading and inference on single and multiple rbln device settings for different downstream tasks.
5
5
  Project-URL: Homepage, https://rebellions.ai
6
6
  Project-URL: Documentation, https://docs.rbln.ai
@@ -1,7 +1,7 @@
1
1
  optimum/rbln/__init__.py,sha256=AZ-7X3ZCjMNcz4mkC_98y-HWRw38ijh8gETJet9tiyM,18828
2
- optimum/rbln/__version__.py,sha256=SknjPrWnnK8RN1n8X1WB74WmhEFBtAnbp5Zb4GrhDlA,712
2
+ optimum/rbln/__version__.py,sha256=tBr7Pz7fkShuqUHVnIf1VZ9ey-Bfa4EMQ2i12M-O1gY,712
3
3
  optimum/rbln/configuration_utils.py,sha256=KFibQ8IYcapw3M1GpgNLgQ1ZolRIip0_bOlwfU0OYac,38193
4
- optimum/rbln/modeling.py,sha256=jfYPOl0FmYq6B3et3rmoCbiWV4939LlVgs-PrZ7IWIk,16928
4
+ optimum/rbln/modeling.py,sha256=h-Iiku3l9KWF1fBpg3loG74VWU13_n7VjVdry5OC06A,16082
5
5
  optimum/rbln/modeling_base.py,sha256=poXfHZCAlFd28MY9dvMi7tC2RytLx77Lee2XGS_KeZg,27684
6
6
  optimum/rbln/diffusers/__init__.py,sha256=1tgU_xWA42BmInqu9bBz_5R_E9TGhhK3mI06YlaiTLg,7232
7
7
  optimum/rbln/diffusers/modeling_diffusers.py,sha256=egx137ECmNA0bK2JPRUOpxCl1Wb3qOpE-xSaPaJOs-g,20549
@@ -110,7 +110,7 @@ optimum/rbln/transformers/models/decoderonly/decoderonly_architecture.py,sha256=
110
110
  optimum/rbln/transformers/models/decoderonly/decoderonly_runtime_utils.py,sha256=2yGU1JfxCepG37DbyY8oWq3gMIKhMnPyBkLH8VniKfA,21530
111
111
  optimum/rbln/transformers/models/decoderonly/generation_decoderonly.py,sha256=zabSgQd2VzHhkpbhUFW5Z-CjYB1JvSJOb5yXKjXCQV0,4326
112
112
  optimum/rbln/transformers/models/decoderonly/lora_architecture.py,sha256=jo-jYy95JhdvOsX1UTCXeYTNer37wBbtY578C0QQpZo,8306
113
- optimum/rbln/transformers/models/decoderonly/modeling_decoderonly.py,sha256=myXdyYLivoPVJVGa2vmeaGLFxmjw-vUyYYsNTAX41yk,35907
113
+ optimum/rbln/transformers/models/decoderonly/modeling_decoderonly.py,sha256=lAPVrH-EoW48g3TGHgLs0Wvx9UGpyQh3eOO90qvQAlI,36213
114
114
  optimum/rbln/transformers/models/depth_anything/__init__.py,sha256=xvPSIriMJWyNeVYoVB1Z7YqB4kkHOIkaHq7loNps-dk,756
115
115
  optimum/rbln/transformers/models/depth_anything/configuration_depth_anything.py,sha256=JujBVEUa_zZDXNPr1y-B_PhK5SgFFcY8Ib4EoGjjtmE,989
116
116
  optimum/rbln/transformers/models/depth_anything/modeling_depth_anything.py,sha256=tTmsVaW9Wb2WD3nKRLwp7swn3hbMvgwUEJwwVIfNYEc,1008
@@ -245,7 +245,7 @@ optimum/rbln/utils/model_utils.py,sha256=4k5879Kh75m3x_vS4-qOGfqsOiAvc2kdNFFfvsF
245
245
  optimum/rbln/utils/runtime_utils.py,sha256=R6uXDbeJP03-FWdd4vthNe2D4aCra5n12E3WB1ifiGM,7933
246
246
  optimum/rbln/utils/save_utils.py,sha256=hG5uOtYmecSXZuGTvCXsTM-SiyZpr5q3InUGCCq_jzQ,3619
247
247
  optimum/rbln/utils/submodule.py,sha256=SKLnM3KsX8_rv3HauO4oB2-JSjzuadQjRwo_BhMUzLI,6362
248
- optimum_rbln-0.9.2a5.dist-info/METADATA,sha256=8gm204ZrCL7yjPNG5vEGsSE5RhIDtPk2H-eWGFxX8yw,5350
249
- optimum_rbln-0.9.2a5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
250
- optimum_rbln-0.9.2a5.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
251
- optimum_rbln-0.9.2a5.dist-info/RECORD,,
248
+ optimum_rbln-0.9.2a7.dist-info/METADATA,sha256=JjNz9cm2rrGv-28JFHeo8X1MbyTE3YCTURDRoQlA79g,5350
249
+ optimum_rbln-0.9.2a7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
250
+ optimum_rbln-0.9.2a7.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
251
+ optimum_rbln-0.9.2a7.dist-info/RECORD,,