optimum-rbln 0.8.1rc0__py3-none-any.whl → 0.8.2a0__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.
- optimum/rbln/__version__.py +2 -2
- optimum/rbln/diffusers/configurations/models/__init__.py +1 -1
- optimum/rbln/diffusers/configurations/models/configuration_autoencoder_kl_cosmos.py +5 -3
- optimum/rbln/diffusers/configurations/models/{configuration_cosmos_transformer.py → configuration_transformer_cosmos.py} +4 -2
- optimum/rbln/diffusers/configurations/pipelines/configuration_cosmos.py +10 -6
- optimum/rbln/diffusers/pipelines/cosmos/cosmos_guardrail.py +5 -1
- optimum/rbln/diffusers/pipelines/cosmos/pipeline_cosmos_text2world.py +1 -1
- optimum/rbln/diffusers/pipelines/cosmos/pipeline_cosmos_video2world.py +1 -1
- optimum/rbln/transformers/models/blip_2/configuration_blip_2.py +2 -2
- optimum/rbln/transformers/models/colpali/configuration_colpali.py +2 -2
- optimum/rbln/transformers/models/decoderonly/decoderonly_architecture.py +212 -257
- optimum/rbln/transformers/models/exaone/exaone_architecture.py +17 -42
- optimum/rbln/transformers/models/gemma/gemma_architecture.py +2 -40
- optimum/rbln/transformers/models/gemma3/gemma3_architecture.py +9 -63
- optimum/rbln/transformers/models/gpt2/gpt2_architecture.py +18 -22
- optimum/rbln/transformers/models/midm/midm_architecture.py +14 -22
- optimum/rbln/transformers/models/opt/opt_architecture.py +16 -25
- optimum/rbln/transformers/models/phi/phi_architecture.py +14 -20
- {optimum_rbln-0.8.1rc0.dist-info → optimum_rbln-0.8.2a0.dist-info}/METADATA +1 -1
- {optimum_rbln-0.8.1rc0.dist-info → optimum_rbln-0.8.2a0.dist-info}/RECORD +22 -22
- {optimum_rbln-0.8.1rc0.dist-info → optimum_rbln-0.8.2a0.dist-info}/WHEEL +0 -0
- {optimum_rbln-0.8.1rc0.dist-info → optimum_rbln-0.8.2a0.dist-info}/licenses/LICENSE +0 -0
optimum/rbln/__version__.py
CHANGED
|
@@ -17,5 +17,5 @@ __version__: str
|
|
|
17
17
|
__version_tuple__: VERSION_TUPLE
|
|
18
18
|
version_tuple: VERSION_TUPLE
|
|
19
19
|
|
|
20
|
-
__version__ = version = '0.8.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 8,
|
|
20
|
+
__version__ = version = '0.8.2a0'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 8, 2, 'a0')
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
from .configuration_autoencoder_kl import RBLNAutoencoderKLConfig
|
|
2
2
|
from .configuration_autoencoder_kl_cosmos import RBLNAutoencoderKLCosmosConfig
|
|
3
3
|
from .configuration_controlnet import RBLNControlNetModelConfig
|
|
4
|
-
from .configuration_cosmos_transformer import RBLNCosmosTransformer3DModelConfig
|
|
5
4
|
from .configuration_prior_transformer import RBLNPriorTransformerConfig
|
|
5
|
+
from .configuration_transformer_cosmos import RBLNCosmosTransformer3DModelConfig
|
|
6
6
|
from .configuration_transformer_sd3 import RBLNSD3Transformer2DModelConfig
|
|
7
7
|
from .configuration_unet_2d_condition import RBLNUNet2DConditionModelConfig
|
|
8
8
|
from .configuration_vq_model import RBLNVQModelConfig
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
from typing import Optional
|
|
15
|
+
from typing import Any, Dict, Optional
|
|
16
16
|
|
|
17
17
|
from ....configuration_utils import RBLNModelConfig
|
|
18
18
|
from ....utils.logging import get_logger
|
|
@@ -22,6 +22,8 @@ logger = get_logger(__name__)
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
class RBLNAutoencoderKLCosmosConfig(RBLNModelConfig):
|
|
25
|
+
"""Configuration class for RBLN Cosmos Variational Autoencoder (VAE) models."""
|
|
26
|
+
|
|
25
27
|
def __init__(
|
|
26
28
|
self,
|
|
27
29
|
batch_size: Optional[int] = None,
|
|
@@ -33,7 +35,7 @@ class RBLNAutoencoderKLCosmosConfig(RBLNModelConfig):
|
|
|
33
35
|
vae_scale_factor_temporal: Optional[int] = None,
|
|
34
36
|
vae_scale_factor_spatial: Optional[int] = None,
|
|
35
37
|
use_slicing: Optional[bool] = None,
|
|
36
|
-
**kwargs,
|
|
38
|
+
**kwargs: Dict[str, Any],
|
|
37
39
|
):
|
|
38
40
|
"""
|
|
39
41
|
Args:
|
|
@@ -48,7 +50,7 @@ class RBLNAutoencoderKLCosmosConfig(RBLNModelConfig):
|
|
|
48
50
|
Determines how much shorter the latent representations are compared to the original videos.
|
|
49
51
|
vae_scale_factor_spatial (Optional[int]): The scaling factor between pixel space and latent space.
|
|
50
52
|
Determines how much smaller the latent representations are compared to the original videos.
|
|
51
|
-
use_slicing (Optional[
|
|
53
|
+
use_slicing (Optional[bool]): Enable sliced VAE encoding and decoding.
|
|
52
54
|
If True, the VAE will split the input tensor in slices to compute encoding or decoding in several steps.
|
|
53
55
|
**kwargs: Additional arguments passed to the parent RBLNModelConfig.
|
|
54
56
|
|
|
@@ -12,12 +12,14 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
from typing import Optional
|
|
15
|
+
from typing import Any, Dict, Optional
|
|
16
16
|
|
|
17
17
|
from ....configuration_utils import RBLNModelConfig
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
class RBLNCosmosTransformer3DModelConfig(RBLNModelConfig):
|
|
21
|
+
"""Configuration class for RBLN Cosmos Transformer models."""
|
|
22
|
+
|
|
21
23
|
def __init__(
|
|
22
24
|
self,
|
|
23
25
|
batch_size: Optional[int] = None,
|
|
@@ -31,7 +33,7 @@ class RBLNCosmosTransformer3DModelConfig(RBLNModelConfig):
|
|
|
31
33
|
num_latent_frames: Optional[int] = None,
|
|
32
34
|
latent_height: Optional[int] = None,
|
|
33
35
|
latent_width: Optional[int] = None,
|
|
34
|
-
**kwargs,
|
|
36
|
+
**kwargs: Dict[str, Any],
|
|
35
37
|
):
|
|
36
38
|
"""
|
|
37
39
|
Args:
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
from typing import Optional
|
|
15
|
+
from typing import Any, Dict, Optional
|
|
16
16
|
|
|
17
17
|
from ....configuration_utils import RBLNModelConfig
|
|
18
18
|
from ....transformers import RBLNT5EncoderModelConfig
|
|
@@ -24,7 +24,7 @@ from ..models import RBLNAutoencoderKLCosmosConfig, RBLNCosmosTransformer3DModel
|
|
|
24
24
|
logger = get_logger(__name__)
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
class
|
|
27
|
+
class RBLNCosmosPipelineBaseConfig(RBLNModelConfig):
|
|
28
28
|
submodules = ["text_encoder", "transformer", "vae", "safety_checker"]
|
|
29
29
|
_vae_uses_encoder = False
|
|
30
30
|
|
|
@@ -41,13 +41,13 @@ class _RBLNCosmosPipelineBaseConfig(RBLNModelConfig):
|
|
|
41
41
|
num_frames: Optional[int] = None,
|
|
42
42
|
fps: Optional[int] = None,
|
|
43
43
|
max_seq_len: Optional[int] = None,
|
|
44
|
-
**kwargs,
|
|
44
|
+
**kwargs: Dict[str, Any],
|
|
45
45
|
):
|
|
46
46
|
"""
|
|
47
47
|
Args:
|
|
48
48
|
text_encoder (Optional[RBLNT5EncoderModelConfig]): Configuration for the text encoder component.
|
|
49
49
|
Initialized as RBLNT5EncoderModelConfig if not provided.
|
|
50
|
-
transformer (Optional[RBLNCosmosTransformer3DModelConfig]): Configuration for the
|
|
50
|
+
transformer (Optional[RBLNCosmosTransformer3DModelConfig]): Configuration for the Transformer model component.
|
|
51
51
|
Initialized as RBLNCosmosTransformer3DModelConfig if not provided.
|
|
52
52
|
vae (Optional[RBLNAutoencoderKLCosmosConfig]): Configuration for the VAE model component.
|
|
53
53
|
Initialized as RBLNAutoencoderKLCosmosConfig if not provided.
|
|
@@ -102,9 +102,13 @@ class _RBLNCosmosPipelineBaseConfig(RBLNModelConfig):
|
|
|
102
102
|
return self.text_encoder.max_seq_len
|
|
103
103
|
|
|
104
104
|
|
|
105
|
-
class RBLNCosmosTextToWorldPipelineConfig(
|
|
105
|
+
class RBLNCosmosTextToWorldPipelineConfig(RBLNCosmosPipelineBaseConfig):
|
|
106
|
+
"""Config for Cosmos Text2World Pipeline"""
|
|
107
|
+
|
|
106
108
|
_vae_uses_encoder = False
|
|
107
109
|
|
|
108
110
|
|
|
109
|
-
class RBLNCosmosVideoToWorldPipelineConfig(
|
|
111
|
+
class RBLNCosmosVideoToWorldPipelineConfig(RBLNCosmosPipelineBaseConfig):
|
|
112
|
+
"""Config for Cosmos Video2World Pipeline"""
|
|
113
|
+
|
|
110
114
|
_vae_uses_encoder = True
|
|
@@ -130,7 +130,8 @@ class RBLNSigLIPEncoder(SigLIPEncoder):
|
|
|
130
130
|
self.checkpoint_dir,
|
|
131
131
|
rbln_device=rbln_config.siglip_encoder.device,
|
|
132
132
|
rbln_create_runtimes=rbln_config.siglip_encoder.create_runtimes,
|
|
133
|
-
rbln_activate_profiler=rbln_config.
|
|
133
|
+
rbln_activate_profiler=rbln_config.siglip_encoder.activate_profiler,
|
|
134
|
+
rbln_optimize_host_memory=rbln_config.siglip_encoder.optimize_host_memory,
|
|
134
135
|
)
|
|
135
136
|
else:
|
|
136
137
|
super().__init__(model_name, checkpoint_id)
|
|
@@ -143,6 +144,7 @@ class RBLNSigLIPEncoder(SigLIPEncoder):
|
|
|
143
144
|
rbln_npu=rbln_config.siglip_encoder.npu,
|
|
144
145
|
rbln_create_runtimes=rbln_config.siglip_encoder.create_runtimes,
|
|
145
146
|
rbln_activate_profiler=rbln_config.siglip_encoder.activate_profiler,
|
|
147
|
+
rbln_optimize_host_memory=rbln_config.siglip_encoder.optimize_host_memory,
|
|
146
148
|
)
|
|
147
149
|
self.rbln_config = rbln_config
|
|
148
150
|
|
|
@@ -339,6 +341,7 @@ class RBLNAegis(Aegis):
|
|
|
339
341
|
rbln_device=rbln_config.aegis.device,
|
|
340
342
|
rbln_create_runtimes=rbln_config.aegis.create_runtimes,
|
|
341
343
|
rbln_activate_profiler=rbln_config.aegis.activate_profiler,
|
|
344
|
+
rbln_optimize_host_memory=rbln_config.aegis.optimize_host_memory,
|
|
342
345
|
)
|
|
343
346
|
|
|
344
347
|
else:
|
|
@@ -353,6 +356,7 @@ class RBLNAegis(Aegis):
|
|
|
353
356
|
rbln_create_runtimes=rbln_config.aegis.create_runtimes,
|
|
354
357
|
rbln_npu=rbln_config.aegis.npu,
|
|
355
358
|
rbln_activate_profiler=rbln_config.aegis.activate_profiler,
|
|
359
|
+
rbln_optimize_host_memory=rbln_config.aegis.optimize_host_memory,
|
|
356
360
|
)
|
|
357
361
|
|
|
358
362
|
self.rbln_config = rbln_config
|
|
@@ -35,7 +35,7 @@ class RBLNCosmosTextToWorldPipeline(RBLNDiffusionMixin, CosmosTextToWorldPipelin
|
|
|
35
35
|
RBLN-accelerated implementation of Cosmos Text to World pipeline for text-to-video generation.
|
|
36
36
|
|
|
37
37
|
This pipeline compiles Cosmos Text to World models to run efficiently on RBLN NPUs, enabling high-performance
|
|
38
|
-
inference for generating
|
|
38
|
+
inference for generating videos with distinctive artistic style and enhanced visual quality.
|
|
39
39
|
"""
|
|
40
40
|
|
|
41
41
|
original_class = CosmosTextToWorldPipeline
|
|
@@ -35,7 +35,7 @@ class RBLNCosmosVideoToWorldPipeline(RBLNDiffusionMixin, CosmosVideoToWorldPipel
|
|
|
35
35
|
RBLN-accelerated implementation of Cosmos Video to World pipeline for video-to-video generation.
|
|
36
36
|
|
|
37
37
|
This pipeline compiles Cosmos Video to World models to run efficiently on RBLN NPUs, enabling high-performance
|
|
38
|
-
inference for generating
|
|
38
|
+
inference for generating videos with distinctive artistic style and enhanced visual quality.
|
|
39
39
|
"""
|
|
40
40
|
|
|
41
41
|
original_class = CosmosVideoToWorldPipeline
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
from typing import Optional
|
|
15
|
+
from typing import Any, Dict, Optional
|
|
16
16
|
|
|
17
17
|
from ....configuration_utils import RBLNModelConfig
|
|
18
18
|
|
|
@@ -62,7 +62,7 @@ class RBLNBlip2ForConditionalGenerationConfig(RBLNModelConfig):
|
|
|
62
62
|
vision_model: Optional[RBLNModelConfig] = None,
|
|
63
63
|
qformer: Optional[RBLNModelConfig] = None,
|
|
64
64
|
language_model: Optional[RBLNModelConfig] = None,
|
|
65
|
-
**kwargs,
|
|
65
|
+
**kwargs: Dict[str, Any],
|
|
66
66
|
):
|
|
67
67
|
"""
|
|
68
68
|
Args:
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
-
from typing import List, Optional, Union
|
|
14
|
+
from typing import Any, Dict, List, Optional, Union
|
|
15
15
|
|
|
16
16
|
from ....configuration_utils import RBLNModelConfig
|
|
17
17
|
|
|
@@ -50,7 +50,7 @@ class RBLNColPaliForRetrievalConfig(RBLNModelConfig):
|
|
|
50
50
|
max_seq_lens: Union[int, List[int]] = None,
|
|
51
51
|
output_hidden_states: Optional[bool] = None,
|
|
52
52
|
vision_tower: Optional[RBLNModelConfig] = None,
|
|
53
|
-
**kwargs,
|
|
53
|
+
**kwargs: Dict[str, Any],
|
|
54
54
|
):
|
|
55
55
|
"""
|
|
56
56
|
Args:
|