Skip to content
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

Deprecate unused field DataComponentConfig::name #1178

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,10 @@ Then the design for `DataContainer` interface will be like:
DataConfig(
components={
"load_dataset": {
"name": "test_dataset",
"type": "test_dataset",
"params": {"test_value": "test_value"},
},
"dataloader": {
"name": "test_dataloader",
"type": "_test_dataloader", # This is the key to get dataloader
"params": {"test_value": "test_value"},
},
Expand Down
10 changes: 0 additions & 10 deletions docs/source/tutorials/configure_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ Then the complete config would be like:
"type": "DataContainer",
"components": {
"load_dataset": {
"name": "_huggingface_dataset",
"type": "huggingface_dataset",
"params": {
"data_dir": null,
Expand All @@ -224,7 +223,6 @@ Then the complete config would be like:
}
},
"pre_process_data": {
"name": "_huggingface_pre_process",
"type": "huggingface_pre_process",
"params": {
"model_name": "Intel/bert-base-uncased-mrpc",
Expand All @@ -239,12 +237,10 @@ Then the complete config would be like:
}
},
"post_process_data": {
"name": "_text_classification_post_process",
"type": "text_classification_post_process",
"params": {}
},
"dataloader": {
"name": "_default_dataloader",
"type": "default_dataloader",
"params": {
"batch_size": 1
Expand All @@ -263,7 +259,6 @@ Then the complete config would be like:
type="DataContainer",
components={
"load_dataset": {
"name": "_huggingface_dataset",
"type": "huggingface_dataset",
"params": {
"data_dir": null,
Expand All @@ -274,7 +269,6 @@ Then the complete config would be like:
}
},
"pre_process_data": {
"name": "_huggingface_pre_process",
"type": "huggingface_pre_process",
"params": {
"model_name": "Intel/bert-base-uncased-mrpc",
Expand All @@ -289,12 +283,10 @@ Then the complete config would be like:
}
},
"post_process_data": {
"name": "_text_classification_post_process",
"type": "text_classification_post_process",
"params": {}
},
"dataloader": {
"name": "_default_dataloader",
"type": "default_dataloader",
"params": {
"batch_size": 1
Expand Down Expand Up @@ -322,7 +314,6 @@ The above case shows to rewrite all the components in data config. But sometime,
"script_dir": "user_dir",
"components": {
"load_dataset": {
"name": "_huggingface_dataset",
"type": "customized_huggingface_dataset",
"params": {
"data_dir": null,
Expand Down Expand Up @@ -351,7 +342,6 @@ The above case shows to rewrite all the components in data config. But sometime,
script_dir="user_dir",
components={
"load_dataset": {
"name": "_huggingface_dataset",
"type": "customized_huggingface_dataset",
"params": {
"data_dir": null,
Expand Down
4 changes: 1 addition & 3 deletions olive/data/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@


class DataComponentConfig(ConfigBase):
name: str = None
type: str = None
params: Dict = None

Expand Down Expand Up @@ -95,7 +94,6 @@ def update_components(self):
else:
# both are strings, so we don't need to deepcopy
self.components[k].type = self.components[k].type or v.type
self.components[k].name = self.components[k].name or v.name
# v.params is a dict, so we deepcopy it
self.components[k].params = self.components[k].params or deepcopy(v.params)

Expand All @@ -115,7 +113,7 @@ def _update_default_component_type(self):
def _update_default_component(self):
"""Resolve the default component type."""
for k, v in self.default_components_type.items():
self.default_components[k] = DataComponentConfig(type=v, name=v, params={})
self.default_components[k] = DataComponentConfig(type=v, params={})

def fill_in_params(self):
"""Fill in the default parameters for each component.
Expand Down
2 changes: 0 additions & 2 deletions test/unit_test/passes/openvino/test_openvino_quantization.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def test_openvino_quantization(data_source, tmp_path):
name="test_dc_config",
components={
"load_dataset": {
"name": "cifar10_dataset",
"type": "cifar10_dataset",
"params": {"data_dir": data_dir},
}
Expand Down Expand Up @@ -88,7 +87,6 @@ def test_openvino_quantization_with_accuracy(data_source, tmp_path):
name="test_dc_config",
components={
"load_dataset": {
"name": "cifar10_dataset",
"type": "cifar10_dataset",
"params": {"data_dir": data_dir},
}
Expand Down
2 changes: 0 additions & 2 deletions test/unit_test/test_data_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ def get_data_config():
name="test_data_config",
components={
"load_dataset": {
"name": "dummy_dataset_dataroot",
"type": "dummy_dataset_dataroot",
"params": {"data_dir": "data"},
},
Expand Down Expand Up @@ -152,7 +151,6 @@ def get_data_config():
name="test_data_config",
components={
"load_dataset": {
"name": "dummy_dataset_dataroot",
"type": "dummy_dataset_dataroot",
"params": {"data_dir": "perfdata"},
},
Expand Down
2 changes: 0 additions & 2 deletions test/unit_test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,10 @@ def _post_process(output, test_value): ...
name="test_data_config",
components={
"load_dataset": {
"name": "test_dataset",
"type": "test_dataset", # renamed by Registry.register_dataset
"params": {"test_value": "test_value"},
},
"dataloader": {
"name": "test_dataloader",
"type": "_test_dataloader", # This is the key to get dataloader
"params": {"test_value": "test_value"},
},
Expand Down
Loading