Skip to content
Closed
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
7 changes: 4 additions & 3 deletions src/main/java/org/apache/sysds/hops/cost/HopRel.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,10 @@ public String toString(){
strB.append(", FedOut: ");
strB.append(fedOut);
strB.append(", Cost: ");
strB.append(cost);
strB.append(", Number of inputs: ");
strB.append(inputDependency.size());
strB.append(cost.getTotal());
strB.append(", Inputs: ");
strB.append(inputDependency.stream().map(i -> "{" + i.getHopRef().getHopID() +
", " + i.getFederatedOutput() + "}").collect(Collectors.toList()));
strB.append("}");
return strB.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ public class FederatedL2SVMPlanningTest extends AutomatedTestBase {
private final static String TEST_DIR = "functions/privacy/fedplanning/";
private final static String TEST_NAME = "FederatedL2SVMPlanningTest";
private final static String TEST_CLASS_DIR = TEST_DIR + FederatedL2SVMPlanningTest.class.getSimpleName() + "/";
private final static String TEST_CONF = "SystemDS-config-fout.xml";
private final static File TEST_CONF_FILE = new File(SCRIPT_DIR + TEST_DIR, TEST_CONF);
private static File TEST_CONF_FILE;

private final static int blocksize = 1024;
public final int rows = 100;
Expand All @@ -57,12 +56,33 @@ public void setUp() {
}

@Test
public void runL2SVMTest(){
public void runL2SVMFOUTTest(){
String[] expectedHeavyHitters = new String[]{ "fed_fedinit", "fed_ba+*", "fed_tak+*", "fed_+*",
"fed_max", "fed_1-*", "fed_tsmm", "fed_>"};
setTestConf("SystemDS-config-fout.xml");
loadAndRunTest(expectedHeavyHitters);
}

@Test
public void runL2SVMHeuristicTest(){
String[] expectedHeavyHitters = new String[]{ "fed_fedinit", "fed_ba+*"};
setTestConf("SystemDS-config-heuristic.xml");
loadAndRunTest(expectedHeavyHitters);
}

@Test
public void runL2SVMCostBasedTest(){
//String[] expectedHeavyHitters = new String[]{ "fed_fedinit", "fed_ba+*", "fed_tak+*", "fed_+*",
// "fed_max", "fed_1-*", "fed_tsmm", "fed_>"};
String[] expectedHeavyHitters = new String[]{ "fed_fedinit"};
setTestConf("SystemDS-config-cost-based.xml");
loadAndRunTest(expectedHeavyHitters);
}

private void setTestConf(String test_conf){
TEST_CONF_FILE = new File(SCRIPT_DIR + TEST_DIR, test_conf);
}

private void writeInputMatrices(){
writeStandardRowFedMatrix("X1", 65, null);
writeStandardRowFedMatrix("X2", 75, null);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
-->

<root>
<!-- set the federated plan generator (none, [runtime], compile_fed_all, compile_fed_heuristic, compile_cost_based) -->
<sysds.federated.planner>compile_cost_based</sysds.federated.planner>
</root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
-->

<root>
<!-- set the federated plan generator (none, [runtime], compile_fed_all, compile_fed_heuristic, compile_cost_based) -->
<sysds.federated.planner>compile_fed_heuristic</sysds.federated.planner>
</root>