Skip to content

Conversation

@liouxiao
Copy link

@liouxiao liouxiao commented Aug 2, 2024

we are using Fate 1.11 with dsl_version = 2, and find the namespaces of different hosts are always same - although we use different name for them.

For example, we have 2 hosts - "host1" (with dataset "ns1"), "host2" (with dataset "ns2"), but the dashboard shows both hosts' datasets as "ns2".

The issue is caused by RuntimeConfParserV2.get_input_parameters() -

input_parameters[role] = [copy.deepcopy(cpn_dict)] * len(submit_dict["role"][role])
, or https://github.com/FederatedAI/FATE-Flow/blob/dev-1.11.2/python/fate_flow/utils/runtime_conf_parse_util.py#L518

the elements of input_parameters[role] all refer to the same object!

Look at these example:

a = [{}] * 2
a[0]['key'] = 'value'
print(a)
print(id(a[0]))
print(id(a[1]))

the output is:

[{'key': 'value'}, {'key': 'value'}]
1925659892800
1925659892800

both a[0] and a[1] are actually the same object.

The solution is to replace the assignment with "List Comprehensions", like:

a = [{} for _ in range(2)]
Signed-off-by: liuxiaoxi <liuxiaoxi@sdibc.cn>
@liouxiao liouxiao force-pushed the bugfix_duplicated_dataset_namespace branch from 67ce3c6 to ca0d146 Compare August 2, 2024 02:04
@dylan-fan dylan-fan changed the base branch from dev-1.11.2 to main-1.x December 24, 2024 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant