You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@systemds.apache.org by GitBox <gi...@apache.org> on 2021/03/12 16:14:53 UTC
[GitHub] [systemds] sebwrede opened a new pull request #1199: [SYSTEMDS-2604] Federated compile and federated output propagation
sebwrede opened a new pull request #1199:
URL: https://github.com/apache/systemds/pull/1199
This PR adds compilation of federated instructions when `OptimizerUtils.FEDERATED_COMPILATION` is set to true.
Additionally, a federated output flag is added and propagated through HOPs, LOPs, and instructions. The federated output flag will later be used to change the processing of federated instructions so that the output of federated instructions are not retrieved before all subsequent federated instructions have been executed.
The federated compilation and propagation of the federated output flag will be extended to other operations in future PRs.
Several design decisions have been made in this PR, for instance the decision to add the federated output flag as an additional operand in the instruction string. It could also have been added as a property of the output operand, but this would have consequences on how CPOperands are handled in the system. Comments on this or new ideas are appreciated.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [systemds] Baunsgaard commented on pull request #1199: [SYSTEMDS-2604] Federated compile and federated output propagation
Posted by GitBox <gi...@apache.org>.
Baunsgaard commented on pull request #1199:
URL: https://github.com/apache/systemds/pull/1199#issuecomment-799426446
> > did you fix some bugs since it parses all tests?
>
> I removed an empty file, which made one test fail since it did not have an Apache license.
> I also ran the failing tests locally, where I discovered that I needed to install some R packages and some Python packages. One of the R packages, imputeTS, failed to install when I ran our R install script, so I had to look up why this happened. I found a solution where I had to run the following:
>
> ```
> sudo apt-get install aptitude
> sudo apt-get install libcurl4-openssl-dev
> sudo apt-get install libxml2-dev
> ```
>
> This idea came from here: [sagemath/cloud#114 (comment)](https://github.com/sagemath/cloud/issues/114#issuecomment-86363054).
> After installing the above, I ran the R install again and then the tests passed locally. I then committed and pushed. The only update in that commit was the removal of the empty file.
okay, i will try to reinstall my r because i have tests that fail in GitHub actions and not locally...
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [systemds] sebwrede commented on pull request #1199: [SYSTEMDS-2604] Federated compile and federated output propagation
Posted by GitBox <gi...@apache.org>.
sebwrede commented on pull request #1199:
URL: https://github.com/apache/systemds/pull/1199#issuecomment-820281615
> Regarding the chain of OPs, many today need partial output aggregation though I guess.
Yes, this is true. There will be a lot of work with implementing the processing of the federated instructions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [systemds] sebwrede commented on a change in pull request #1199: [SYSTEMDS-2604] Federated compile and federated output propagation
Posted by GitBox <gi...@apache.org>.
sebwrede commented on a change in pull request #1199:
URL: https://github.com/apache/systemds/pull/1199#discussion_r603900326
##########
File path: src/main/java/org/apache/sysds/hops/ReorgOp.java
##########
@@ -76,6 +77,8 @@ public ReorgOp(String l, DataType dt, ValueType vt, ReOrgOp o, ArrayList<Hop> in
getInput().add(i, in);
in.getParent().add(this);
}
+
+ updateETFed();
Review comment:
It is important to have both. In the first one, the execution type and fedoutput will be set during the construction of the Hops (in the order input to output). In the second call in "optFindExecType", it will set the exectype so that a once federated execution is not converted to a CP. This will happen in the order output to input (plus additional calls in certain cases).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [systemds] sebwrede commented on a change in pull request #1199: [SYSTEMDS-2604] Federated compile and federated output propagation
Posted by GitBox <gi...@apache.org>.
sebwrede commented on a change in pull request #1199:
URL: https://github.com/apache/systemds/pull/1199#discussion_r603900841
##########
File path: src/main/java/org/apache/sysds/runtime/instructions/FEDInstructionParser.java
##########
@@ -32,8 +36,28 @@
public static final HashMap<String, FEDType> String2FEDInstructionType;
static {
String2FEDInstructionType = new HashMap<>();
- String2FEDInstructionType.put("fedinit", FEDType.Init);
- String2FEDInstructionType.put("ba+*", FEDType.AggregateBinary);
+ String2FEDInstructionType.put("fedinit" , FEDType.Init);
+ String2FEDInstructionType.put("tsmm" , FEDType.Tsmm);
+ String2FEDInstructionType.put("ba+*" , FEDType.AggregateBinary);
+
+ String2FEDInstructionType.put("uak+" , FEDType.AggregateUnary);
+ String2FEDInstructionType.put( "uark+" , FEDType.AggregateUnary);
+ String2FEDInstructionType.put( "uack+" , FEDType.AggregateUnary);
+ String2FEDInstructionType.put( "uasqk+" , FEDType.AggregateUnary);
+ String2FEDInstructionType.put( "uarsqk+" , FEDType.AggregateUnary);
+ String2FEDInstructionType.put( "uacsqk+" , FEDType.AggregateUnary);
Review comment:
What do you mean?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [systemds] Baunsgaard commented on a change in pull request #1199: [SYSTEMDS-2604] Federated compile and federated output propagation
Posted by GitBox <gi...@apache.org>.
Baunsgaard commented on a change in pull request #1199:
URL: https://github.com/apache/systemds/pull/1199#discussion_r603902487
##########
File path: src/main/java/org/apache/sysds/runtime/instructions/FEDInstructionParser.java
##########
@@ -32,8 +36,28 @@
public static final HashMap<String, FEDType> String2FEDInstructionType;
static {
String2FEDInstructionType = new HashMap<>();
- String2FEDInstructionType.put("fedinit", FEDType.Init);
- String2FEDInstructionType.put("ba+*", FEDType.AggregateBinary);
+ String2FEDInstructionType.put("fedinit" , FEDType.Init);
+ String2FEDInstructionType.put("tsmm" , FEDType.Tsmm);
+ String2FEDInstructionType.put("ba+*" , FEDType.AggregateBinary);
+
+ String2FEDInstructionType.put("uak+" , FEDType.AggregateUnary);
+ String2FEDInstructionType.put( "uark+" , FEDType.AggregateUnary);
+ String2FEDInstructionType.put( "uack+" , FEDType.AggregateUnary);
+ String2FEDInstructionType.put( "uasqk+" , FEDType.AggregateUnary);
+ String2FEDInstructionType.put( "uarsqk+" , FEDType.AggregateUnary);
+ String2FEDInstructionType.put( "uacsqk+" , FEDType.AggregateUnary);
Review comment:
look at the code, some of the lines you insert spaces, some you don't.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [systemds] asfgit closed pull request #1199: [SYSTEMDS-2604] Federated compile and federated output propagation
Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #1199:
URL: https://github.com/apache/systemds/pull/1199
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [systemds] sebwrede commented on pull request #1199: [SYSTEMDS-2604] Federated compile and federated output propagation
Posted by GitBox <gi...@apache.org>.
sebwrede commented on pull request #1199:
URL: https://github.com/apache/systemds/pull/1199#issuecomment-799417830
> did you fix some bugs since it parses all tests?
I removed an empty file, which made one test fail since it did not have an Apache license.
I also ran the failing tests locally, where I discovered that I needed to install some R packages and some Python packages. One of the R packages, imputeTS, failed to install when I ran our R install script, so I had to look up why this happened. I found a solution where I had to run the following:
```
sudo apt-get install aptitude
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libxml2-dev
```
This idea came from here: https://github.com/sagemath/cloud/issues/114#issuecomment-86363054.
After installing the above, I ran the R install again and then the tests passed locally. I then committed and pushed. The only update in that commit was the removal of the empty file.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [systemds] phaniarnab commented on pull request #1199: [SYSTEMDS-2604] Federated compile and federated output propagation
Posted by GitBox <gi...@apache.org>.
phaniarnab commented on pull request #1199:
URL: https://github.com/apache/systemds/pull/1199#issuecomment-820192434
LGTM.
For my understanding, did you mean that this flag will help to execute a chain of federated operations before fetching the outputs to the coordinator? Is it not the case today?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [systemds] sebwrede commented on a change in pull request #1199: [SYSTEMDS-2604] Federated compile and federated output propagation
Posted by GitBox <gi...@apache.org>.
sebwrede commented on a change in pull request #1199:
URL: https://github.com/apache/systemds/pull/1199#discussion_r603923892
##########
File path: src/main/java/org/apache/sysds/hops/BinaryOp.java
##########
@@ -496,7 +498,7 @@ else if (mbin == MMBinaryMethod.MR_BINARY_M) {
setOutputDimensions(binary);
setLineNumbers(binary);
setLops(binary);
- }
+ } else throw new HopsException("Lop construction not implemented for ExecType " + et);
Review comment:
I have now changed the other throw so that it is also on the same line.
I generally think that it is acceptable to have both, since it makes more sense in some cases to have it on a single line. It depends on the context. If, for instance, the other if-else parts are without brackets then it makes more sense to have the throw on a single line without brackets as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [systemds] phaniarnab commented on pull request #1199: [SYSTEMDS-2604] Federated compile and federated output propagation
Posted by GitBox <gi...@apache.org>.
phaniarnab commented on pull request #1199:
URL: https://github.com/apache/systemds/pull/1199#issuecomment-820276233
> > For my understanding, did you mean that this flag will help to execute a chain of federated operations before fetching the outputs to the coordinator? Is it not the case today?
>
> This PR adds a flag to compile the federated instructions during compile-time instead of simply converting the CP instructions to FED instructions during runtime. Later, the decision to compile to FED will be expanded so that it can base the decision on several scenarios, including the scenario where a chain of federated operations can be executed without sharing the data with the coordinator. Many of the FED instructions are currently implemented in a way that keeps the output federated, but this decision of keeping the output federated needs to be dependent on the flag so that we can have some kind of "FED planner" which compiles this information.
> At the moment, the federated instructions do not take the privacy constraints into account. When we have a FED planner, it could discover a privacy constraint on some input data and then compile the instructions accordingly. This may in some cases mean that it does not just blindly pick the chain of federated instructions, but instead considers the privacy constraint and makes a new plan that adheres to the constraint. This is just an example of how the FED planner will be convenient later on.
> I implemented this as a federated output flag to begin with, but this will likely be expanded later on since there are more decisions than just federated vs. local. I will deal with this in later PRs when I have a basic FED planner and support federated compilation of more operations.
Got it. Thanks for explaining in detail. Pushing the decision to the compiler seems to be a good idea. Regarding the chain of OPs, many today need partial output aggregation though I guess.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [systemds] sebwrede commented on a change in pull request #1199: [SYSTEMDS-2604] Federated compile and federated output propagation
Posted by GitBox <gi...@apache.org>.
sebwrede commented on a change in pull request #1199:
URL: https://github.com/apache/systemds/pull/1199#discussion_r603903661
##########
File path: src/main/java/org/apache/sysds/runtime/instructions/fed/BinaryFEDInstruction.java
##########
@@ -42,11 +47,12 @@ public static BinaryFEDInstruction parseInstruction(String str) {
}
String[] parts = InstructionUtils.getInstructionPartsWithValueType(str);
- InstructionUtils.checkNumFields(parts, 3, 4);
+ InstructionUtils.checkNumFields(parts, 3, 4, 5);
String opcode = parts[0];
CPOperand in1 = new CPOperand(parts[1]);
CPOperand in2 = new CPOperand(parts[2]);
CPOperand out = new CPOperand(parts[3]);
+ boolean federatedOutput = parts.length > 5 && Boolean.parseBoolean(parts[5]);
Review comment:
Number 4 is the number of threads. I assume that this has been included, otherwise we cannot parse a federated output. I try to only write federated output in the cases where it is true, but I leave room for also writing false to the instruction string. This is the reason why I check if it has been included and parse it if it has been included.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [systemds] Baunsgaard commented on a change in pull request #1199: [SYSTEMDS-2604] Federated compile and federated output propagation
Posted by GitBox <gi...@apache.org>.
Baunsgaard commented on a change in pull request #1199:
URL: https://github.com/apache/systemds/pull/1199#discussion_r603899299
##########
File path: src/main/java/org/apache/sysds/hops/BinaryOp.java
##########
@@ -496,7 +498,7 @@ else if (mbin == MMBinaryMethod.MR_BINARY_M) {
setOutputDimensions(binary);
setLineNumbers(binary);
setLops(binary);
- }
+ } else throw new HopsException("Lop construction not implemented for ExecType " + et);
Review comment:
in this pr you do it two different ways, i liked the first better with newline and brackets. I personally would prefer if there was a newline for the throw, if you want to include brackets or not is up to you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [systemds] sebwrede commented on pull request #1199: [SYSTEMDS-2604] Federated compile and federated output propagation
Posted by GitBox <gi...@apache.org>.
sebwrede commented on pull request #1199:
URL: https://github.com/apache/systemds/pull/1199#issuecomment-820219888
> For my understanding, did you mean that this flag will help to execute a chain of federated operations before fetching the outputs to the coordinator? Is it not the case today?
This PR adds a flag to compile the federated instructions during compile-time instead of simply converting the CP instructions to FED instructions during runtime. Later, the decision to compile to FED will be expanded so that it can base the decision on several scenarios, including the scenario where a chain of federated operations can be executed without sharing the data with the coordinator. Many of the FED instructions are currently implemented in a way that keeps the output federated, but this decision of keeping the output federated needs to be dependent on the flag so that we can have some kind of "FED planner" which compiles this information.
At the moment, the federated instructions do not take the privacy constraints into account. When we have a FED planner, it could discover a privacy constraint on some input data and then compile the instructions accordingly. This may in some cases mean that it does not just blindly pick the chain of federated instructions, but instead considers the privacy constraint and makes a new plan that adheres to the constraint. This is just an example of how the FED planner will be convenient later on.
I implemented this as a federated output flag to begin with, but this will likely be expanded later on since there are more decisions than just federated vs. local. I will deal with this in later PRs when I have a basic FED planner and support federated compilation of more operations.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [systemds] Baunsgaard commented on pull request #1199: [SYSTEMDS-2604] Federated compile and federated output propagation
Posted by GitBox <gi...@apache.org>.
Baunsgaard commented on pull request #1199:
URL: https://github.com/apache/systemds/pull/1199#issuecomment-799393259
did you fix some bugs since it parses all tests?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [systemds] Baunsgaard commented on a change in pull request #1199: [SYSTEMDS-2604] Federated compile and federated output propagation
Posted by GitBox <gi...@apache.org>.
Baunsgaard commented on a change in pull request #1199:
URL: https://github.com/apache/systemds/pull/1199#discussion_r603873511
##########
File path: src/main/java/org/apache/sysds/runtime/instructions/FEDInstructionParser.java
##########
@@ -32,8 +36,28 @@
public static final HashMap<String, FEDType> String2FEDInstructionType;
static {
String2FEDInstructionType = new HashMap<>();
- String2FEDInstructionType.put("fedinit", FEDType.Init);
- String2FEDInstructionType.put("ba+*", FEDType.AggregateBinary);
+ String2FEDInstructionType.put("fedinit" , FEDType.Init);
+ String2FEDInstructionType.put("tsmm" , FEDType.Tsmm);
+ String2FEDInstructionType.put("ba+*" , FEDType.AggregateBinary);
+
+ String2FEDInstructionType.put("uak+" , FEDType.AggregateUnary);
+ String2FEDInstructionType.put( "uark+" , FEDType.AggregateUnary);
+ String2FEDInstructionType.put( "uack+" , FEDType.AggregateUnary);
+ String2FEDInstructionType.put( "uasqk+" , FEDType.AggregateUnary);
+ String2FEDInstructionType.put( "uarsqk+" , FEDType.AggregateUnary);
+ String2FEDInstructionType.put( "uacsqk+" , FEDType.AggregateUnary);
Review comment:
inlining
##########
File path: src/main/java/org/apache/sysds/hops/ReorgOp.java
##########
@@ -76,6 +77,8 @@ public ReorgOp(String l, DataType dt, ValueType vt, ReOrgOp o, ArrayList<Hop> in
getInput().add(i, in);
in.getParent().add(this);
}
+
+ updateETFed();
Review comment:
double updateETFed here maybe only one needed?
##########
File path: src/main/java/org/apache/sysds/runtime/instructions/fed/BinaryFEDInstruction.java
##########
@@ -42,11 +47,12 @@ public static BinaryFEDInstruction parseInstruction(String str) {
}
String[] parts = InstructionUtils.getInstructionPartsWithValueType(str);
- InstructionUtils.checkNumFields(parts, 3, 4);
+ InstructionUtils.checkNumFields(parts, 3, 4, 5);
String opcode = parts[0];
CPOperand in1 = new CPOperand(parts[1]);
CPOperand in2 = new CPOperand(parts[2]);
CPOperand out = new CPOperand(parts[3]);
+ boolean federatedOutput = parts.length > 5 && Boolean.parseBoolean(parts[5]);
Review comment:
does this work? should it not be index 4? or is that the number of threads?
##########
File path: src/main/java/org/apache/sysds/hops/BinaryOp.java
##########
@@ -496,7 +498,7 @@ else if (mbin == MMBinaryMethod.MR_BINARY_M) {
setOutputDimensions(binary);
setLineNumbers(binary);
setLops(binary);
- }
+ } else throw new HopsException("Lop construction not implemented for ExecType " + et);
Review comment:
split line
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [systemds] sebwrede commented on a change in pull request #1199: [SYSTEMDS-2604] Federated compile and federated output propagation
Posted by GitBox <gi...@apache.org>.
sebwrede commented on a change in pull request #1199:
URL: https://github.com/apache/systemds/pull/1199#discussion_r603914202
##########
File path: src/main/java/org/apache/sysds/runtime/instructions/FEDInstructionParser.java
##########
@@ -32,8 +36,28 @@
public static final HashMap<String, FEDType> String2FEDInstructionType;
static {
String2FEDInstructionType = new HashMap<>();
- String2FEDInstructionType.put("fedinit", FEDType.Init);
- String2FEDInstructionType.put("ba+*", FEDType.AggregateBinary);
+ String2FEDInstructionType.put("fedinit" , FEDType.Init);
+ String2FEDInstructionType.put("tsmm" , FEDType.Tsmm);
+ String2FEDInstructionType.put("ba+*" , FEDType.AggregateBinary);
+
+ String2FEDInstructionType.put("uak+" , FEDType.AggregateUnary);
+ String2FEDInstructionType.put( "uark+" , FEDType.AggregateUnary);
+ String2FEDInstructionType.put( "uack+" , FEDType.AggregateUnary);
+ String2FEDInstructionType.put( "uasqk+" , FEDType.AggregateUnary);
+ String2FEDInstructionType.put( "uarsqk+" , FEDType.AggregateUnary);
+ String2FEDInstructionType.put( "uacsqk+" , FEDType.AggregateUnary);
Review comment:
I added a new commit with the two spaces added. If you use an editor like IntelliJ, this sort of thing is aligned even if a single space is missing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [systemds] sebwrede commented on a change in pull request #1199: [SYSTEMDS-2604] Federated compile and federated output propagation
Posted by GitBox <gi...@apache.org>.
sebwrede commented on a change in pull request #1199:
URL: https://github.com/apache/systemds/pull/1199#discussion_r603893390
##########
File path: src/main/java/org/apache/sysds/hops/BinaryOp.java
##########
@@ -496,7 +498,7 @@ else if (mbin == MMBinaryMethod.MR_BINARY_M) {
setOutputDimensions(binary);
setLineNumbers(binary);
setLops(binary);
- }
+ } else throw new HopsException("Lop construction not implemented for ExecType " + et);
Review comment:
Why? It is not exceeding the line character limit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org