You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@systemds.apache.org by "WDRshadow (via GitHub)" <gi...@apache.org> on 2024/07/13 15:46:31 UTC
[PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
WDRshadow opened a new pull request, #2050:
URL: https://github.com/apache/systemds/pull/2050
## Main Updated:
1. Fixed a bug that while using multi-GPU with CUDA caused a "CurrentModificationException" error in `ParForProgramBlock`, where the GPU memory is modified during the process of freeing. Multi-GPU can now be used to accerate the `parfor` function and other functions using multiple workers and threads.
2. The mismatch between `_numThreads` and the actual number of threads is resolved when using multiple GPUs device but only allowing a single GPU (`sysds.gpu.availableGPUs=1`) to run `parfor` functions with multiple workers and multiple threads.
## Other bugs in Multi-GPU process:
1. In a multi-GPU environment, when initializing the first instance of `GPUContext` for `cudnnHandle`, `cublasHandle`, and `cusparseHandle` in Jcuda version `10.2.0`, the Native code freezes when executing into Jcuda code. The program cannot continue. This error can easily happen in the test environment of "4070+1080" dual graphics card environment, but sometimes it works fine. This bug is not present in Jcuda version `11.8.0`. This is presumed to be a Jcuda issue and cannot be fixed by SystemDS.
## Other bugs outside Multi-GPU process we found:
1. Example script `scripts/nn/examples/AttentionExample.dml` can not be runned with even one GPU. Error message is `RuntimeException -- Unsupported operator:MAP`. We found that a function (with a high probability that it is the `map` function) passes an operator `_map` to `TernaryOp` class where it is not categorized by a GPU operation.
## TODO List:
1. We'll write a test class to detect whether multi-gpu in `parfor` is actually being implemented.
2. We'll try to fix or work around the multi-GPU run Handle initialization freeze issue.
--
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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
Posted by "WDRshadow (via GitHub)" <gi...@apache.org>.
WDRshadow commented on PR #2050:
URL: https://github.com/apache/systemds/pull/2050#issuecomment-2241065765
@phaniarnab We have implemented test cases based on `EfficientNet`. Each test contains exactly the same training procedure. Parfor-based forward tests are performed using random datasets with the same seed. The number of datasets ranges from `10k` to `500k`. The results using single and dual GPUs are shown below:
| test_id | num_interation | 1_gpu_exec_time_sec | 2_gpu_exec_time_sec |
|:---------------------|-----------------:|----------------------:|----------------------:|
| test01_gpuTest_10k | 10000 | 11.723 | 11.189 |
| test01_gpuTest_20k | 20000 | 13.714 | 12.866 |
| test01_gpuTest_50k | 50000 | 19.755 | 15.616 |
| test01_gpuTest_100k | 100000 | 29.141 | 23.026 |
| test01_gpuTest_200k | 200000 | 49.409 | 37.987 |
| test01_gpuTest_500k | 500000 | 108.874 | 77.917 |
Test environment:
- CPU: `24 vCPU Intel(R) Xeon(R) Platinum 8255C CPU @ 2.50GHz`
- GPU: `RTX2080Ti` * 2
- RAM: `80G`
- OS: `Ubuntu 18.04`
- CUDA: `10.2`
--
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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
Posted by "phaniarnab (via GitHub)" <gi...@apache.org>.
phaniarnab commented on code in PR #2050:
URL: https://github.com/apache/systemds/pull/2050#discussion_r1682486198
##########
src/test/java/org/apache/sysds/test/gpu/multigpu/GPUTest.java:
##########
@@ -0,0 +1,148 @@
+/*
+ * 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.
+ */
+
+package org.apache.sysds.test.gpu.multigpu;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.log4j.AppenderSkeleton;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.apache.log4j.spi.LoggingEvent;
+import org.apache.sysds.runtime.controlprogram.ParForProgramBlock;
+import org.apache.sysds.test.AutomatedTestBase;
+import org.apache.sysds.test.TestConfiguration;
+
+public abstract class GPUTest extends AutomatedTestBase {
+ protected static final String TEST_DIR = "gpu/";
+ protected static final String TEST_CLASS_DIR = TEST_DIR + MultiGPUTest.class.getSimpleName() + "/";
+ protected static final String SINGLE_GPU_TEST = "SingleGPUTest";
+ protected static final String MULTI_GPUS_TEST = "MultiGPUsTest";
+ protected static final String TEST_NAME = "GPUTest";
+ protected static final String DATA_SET = DATASET_DIR + "MNIST/mnist_test.csv";
+ protected static final String SINGLE_TEST_CONFIG = CONFIG_DIR + "SystemDS-SingleGPU-config.xml";
+ protected static final String MULTI_TEST_CONFIG = CONFIG_DIR + "SystemDS-config.xml";
+
+ @Override
+ public void setUp() {
+ TEST_GPU = true;
+ VERBOSE_STATS = true;
+ addTestConfiguration(SINGLE_GPU_TEST,
+ new TestConfiguration(TEST_CLASS_DIR, SINGLE_GPU_TEST, new String[] { "R" }));
+ addTestConfiguration(MULTI_GPUS_TEST,
+ new TestConfiguration(TEST_CLASS_DIR, MULTI_GPUS_TEST, new String[] { "R" }));
+ }
+
+ public abstract void gpuTest();
+
+ /**
+ * Run the test with multiple GPUs
+ *
+ * @param multiGPUs whether to run the test with multiple GPUs
+ */
+ protected void runMultiGPUsTest(boolean multiGPUs) {
+ getAndLoadTestConfiguration(multiGPUs ? MULTI_GPUS_TEST : SINGLE_GPU_TEST);
+
+ String HOME = SCRIPT_DIR + TEST_DIR;
+ fullDMLScriptName = HOME + TEST_NAME + ".dml";
+ programArgs = new String[] { "-args", DATA_SET, output("R"), "-config",
+ multiGPUs ? MULTI_TEST_CONFIG : SINGLE_TEST_CONFIG };
+ fullRScriptName = HOME + TEST_NAME + ".R";
+
+ rCmd = null;
+ InMemoryAppender appender = configureLog4j();
+
+ runTest(true, false, null, -1);
+
+ List<String> logs = appender.getLogMessages();
+ for (String log : logs) {
+ if (log.contains("degree of parallelism")) {
+ int extractedNumThreads = extractNumThreads(log);
+ if (multiGPUs) {
+ assert extractedNumThreads > 1 : "Test failed: _numThreads is not greater than 1";
+ } else {
+ assert extractedNumThreads == 1 : "Test failed: _numThreads is not equal to 1";
Review Comment:
How does this assertion confirms the use of multiple GPUs?
##########
src/test/java/org/apache/sysds/test/gpu/multigpu/GPUTest.java:
##########
@@ -0,0 +1,148 @@
+/*
+ * 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.
+ */
+
+package org.apache.sysds.test.gpu.multigpu;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.log4j.AppenderSkeleton;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.apache.log4j.spi.LoggingEvent;
+import org.apache.sysds.runtime.controlprogram.ParForProgramBlock;
+import org.apache.sysds.test.AutomatedTestBase;
+import org.apache.sysds.test.TestConfiguration;
+
+public abstract class GPUTest extends AutomatedTestBase {
+ protected static final String TEST_DIR = "gpu/";
+ protected static final String TEST_CLASS_DIR = TEST_DIR + MultiGPUTest.class.getSimpleName() + "/";
+ protected static final String SINGLE_GPU_TEST = "SingleGPUTest";
+ protected static final String MULTI_GPUS_TEST = "MultiGPUsTest";
+ protected static final String TEST_NAME = "GPUTest";
+ protected static final String DATA_SET = DATASET_DIR + "MNIST/mnist_test.csv";
+ protected static final String SINGLE_TEST_CONFIG = CONFIG_DIR + "SystemDS-SingleGPU-config.xml";
+ protected static final String MULTI_TEST_CONFIG = CONFIG_DIR + "SystemDS-config.xml";
+
+ @Override
+ public void setUp() {
+ TEST_GPU = true;
+ VERBOSE_STATS = true;
+ addTestConfiguration(SINGLE_GPU_TEST,
+ new TestConfiguration(TEST_CLASS_DIR, SINGLE_GPU_TEST, new String[] { "R" }));
+ addTestConfiguration(MULTI_GPUS_TEST,
+ new TestConfiguration(TEST_CLASS_DIR, MULTI_GPUS_TEST, new String[] { "R" }));
+ }
+
+ public abstract void gpuTest();
+
+ /**
+ * Run the test with multiple GPUs
+ *
+ * @param multiGPUs whether to run the test with multiple GPUs
+ */
+ protected void runMultiGPUsTest(boolean multiGPUs) {
+ getAndLoadTestConfiguration(multiGPUs ? MULTI_GPUS_TEST : SINGLE_GPU_TEST);
+
+ String HOME = SCRIPT_DIR + TEST_DIR;
+ fullDMLScriptName = HOME + TEST_NAME + ".dml";
+ programArgs = new String[] { "-args", DATA_SET, output("R"), "-config",
+ multiGPUs ? MULTI_TEST_CONFIG : SINGLE_TEST_CONFIG };
+ fullRScriptName = HOME + TEST_NAME + ".R";
+
+ rCmd = null;
+ InMemoryAppender appender = configureLog4j();
+
+ runTest(true, false, null, -1);
+
+ List<String> logs = appender.getLogMessages();
+ for (String log : logs) {
+ if (log.contains("degree of parallelism")) {
+ int extractedNumThreads = extractNumThreads(log);
+ if (multiGPUs) {
+ assert extractedNumThreads > 1 : "Test failed: _numThreads is not greater than 1";
+ } else {
+ assert extractedNumThreads == 1 : "Test failed: _numThreads is not equal to 1";
Review Comment:
How does this assertion confirm the use of multiple GPUs?
--
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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
Posted by "phaniarnab (via GitHub)" <gi...@apache.org>.
phaniarnab commented on code in PR #2050:
URL: https://github.com/apache/systemds/pull/2050#discussion_r1676883487
##########
src/main/java/org/apache/sysds/runtime/controlprogram/caching/CacheableData.java:
##########
@@ -229,7 +229,7 @@ protected CacheableData(DataType dt, ValueType vt) {
_uniqueID = _seq.getNextID();
_cacheStatus = CacheStatus.EMPTY;
_numReadThreads = 0;
- _gpuObjects = DMLScript.USE_ACCELERATOR ? new HashMap<>() : null;
+ _gpuObjects = DMLScript.USE_ACCELERATOR ? new ConcurrentHashMap<>() : null;
Review Comment:
Is there a concrete reason for using ConcurrentHashMap?
--
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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
Posted by "WDRshadow (via GitHub)" <gi...@apache.org>.
WDRshadow commented on PR #2050:
URL: https://github.com/apache/systemds/pull/2050#issuecomment-2227150997
> Thanks, @WDRshadow, for initiating the project. As discussed before, please experiment with realistic use cases such as parallel scoring and training. You can use our DNN built-ins.
Thank you for your comment. My partner @KexingLi22 is writing the test classes. We will see it soon. For DNN testing, we were faced with the awkward situation of not having enough suitable GPUs for testing. As I mentioned above, newer graphics cards can not run on Jcuda `10.2.0`. To be precise, `CUDA 10.2` is not supported by RTX30 series, A100 and newer graphics cards. My test environment lacks older graphics cards. Could you please help us to test in a multi-GPU environment with suitable GPUs after we have written the test classes? Or again, could you provide any testing environment for us?
--
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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
Posted by "KexingLi22 (via GitHub)" <gi...@apache.org>.
KexingLi22 commented on PR #2050:
URL: https://github.com/apache/systemds/pull/2050#issuecomment-2231948344
> > > > > Thanks, @WDRshadow, for initiating the project. As discussed before, please experiment with realistic use cases such as parallel scoring and training. You can use our DNN built-ins.
> > > >
> > > >
> > > > Thank you for your comment. My partner @KexingLi22 is writing the test classes. We will see it soon. For DNN testing, we were faced with the awkward situation of not having enough suitable GPUs for testing. As I mentioned above, newer graphics cards can not run on Jcuda `10.2.0`. To be precise, `CUDA 10.2` is not supported by RTX30 series, A100 and newer graphics cards. My test environment lacks older graphics cards. Could you please help us to test in a multi-GPU environment with suitable GPUs after we have written the test classes? Or again, could you provide any testing environment for us?
> > >
> > >
> > > Thanks for clarifying. Unfortunately, at this point, we cannot provide a setup. Once you are done with the project, I can run some performance tests along with our performance test suits. But during the development period, it is not feasible to try every change in our shared node. Without a proper setup of two GPUs, it will be very hard to complete this project. I can offer two possible directions from here:
> > >
> > > 1. Try running SystemDS on this setup with one GPU at CUDA 10.2 and the other at 11. CUDA 11 has some API differences and may not be able to execute all CUDA methods, but you may still have a functioning system. However, I never tried this myself and unsure about the behavior.
> > > 2. Instead of multi-GPU, first implement a multi-stream single-GPU parfor. You need a single GPU with CUDA 10.2. You can use the Jcuda API to create multiple GPU streams, and assign a stream to each parfor thread. This is probably a better alternative.
> >
> >
> > We got a double RTX2080Ti server and tested scripts in `scripts/nn/example`. Except `AttentionExample` can't recognize the operator `_map` and `Example-MNIST_2NN_Leaky_ReLu_Softmax` can't find the source file `mnist_2NN.dml`, the others can run good. But I know none of them are optimized for multiple GPUs. The only function that is currently optimized for multiple GPUs is `parfor`. We will keep testing the scripts in `src/test/java/org/apache/sysds/test/functions/parfor` and write new test scripts for multi-GPUs cases.
>
> Thanks. You do not have to optimize all NN workloads for multi-GPU. Just implementing a robust parfor support is sufficient for this project. Please write scoring scenario using parfor. Create a random matrix of test images and take one of the model. For each row, call the forward path from within a parfor, allowing parallel scoring. Store the inferred class in a separate vector. I hope to see some performance improvement of utilizing multiple GPUs. The parfor tests are not ideal for this project as the operations in those scripts were not targeted for GPUs. You may not see any speedups. However, you can use those tests for unit testing. Did you verify that you are actually using both the GPUs?
THanks for your suggestion, @phaniarnab .
We have written a test class MultiGPUTest.java with single GPU test case, MultipleGPU test case to
run the script, in which the model EfficientNet was trained and predicts using parfor.
Everything works well and the execute time of singleGPU is 35 sec 121ms, of the multiGPU is 27 sec 378 ms.
And as the advice from @WDRshadow, I also try to add the logger instance into both ParforBody and GPUContext to trace the thread and the GPUContext. And I have already add these into the log4j.properties:
# Enable detailed logging for specific classes
log4j.logger.org.apache.sysds.runtime.controlprogram.parfor.ParForBody=DEBUG
log4j.logger.org.apache.sysds.runtime.instructions.gpu.context.GPUContext=DEBUG
But when I run the test,dml script with the parfor function, nothing about this, which I expected shows out :
24/07/16 10:00:00 DEBUG ParForBody - Thread Thread-1 assigned to GPU context 0
How can I solve this problems?
--
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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
Posted by "phaniarnab (via GitHub)" <gi...@apache.org>.
phaniarnab commented on PR #2050:
URL: https://github.com/apache/systemds/pull/2050#issuecomment-2227233567
> > Thanks, @WDRshadow, for initiating the project. As discussed before, please experiment with realistic use cases such as parallel scoring and training. You can use our DNN built-ins.
>
> Thank you for your comment. My partner @KexingLi22 is writing the test classes. We will see it soon. For DNN testing, we were faced with the awkward situation of not having enough suitable GPUs for testing. As I mentioned above, newer graphics cards can not run on Jcuda `10.2.0`. To be precise, `CUDA 10.2` is not supported by RTX30 series, A100 and newer graphics cards. My test environment lacks older graphics cards. Could you please help us to test in a multi-GPU environment with suitable GPUs after we have written the test classes? Or again, could you provide any testing environment for us?
Thanks for clarifying. Unfortunately, at this point, we cannot provide a setup. Once you are done with the project, I can run some performance tests along with our performance test suits. But during the development period, it is not feasible to try every change in our shared node.
Without a proper setup of two GPUs, it will be very hard to complete this project. I can offer two possible directions from here:
1) Try running SystemDS on this setup with one GPU at CUDA 10.2 and the other at 11. CUDA 11 has some API differences and may not be able to execute all CUDA methods, but you may still have a functioning system. However, I never tried this myself and unsure about the behavior.
2) Instead of multi-GPU, first implement a multi-stream single-GPU parfor. You need a single GPU with CUDA 10.2. You can use the Jcuda API to create multiple GPU streams, and assign a stream to each parfor thread. This is probably a better alternative.
--
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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #2050:
URL: https://github.com/apache/systemds/pull/2050#issuecomment-2235905047
## [Codecov](https://app.codecov.io/gh/apache/systemds/pull/2050?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
Attention: Patch coverage is `20.00000%` with `4 lines` in your changes missing coverage. Please review.
> Project coverage is 68.81%. Comparing base [(`f81b76d`)](https://app.codecov.io/gh/apache/systemds/commit/f81b76de742b1815f949c9d2aa9a13eb752499f2?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`46cfbc1`)](https://app.codecov.io/gh/apache/systemds/commit/46cfbc100555af773d097ea6bf5af1cd6d50a5be?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> Report is 1 commits behind head on main.
| [Files](https://app.codecov.io/gh/apache/systemds/pull/2050?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...sds/runtime/controlprogram/ParForProgramBlock.java](https://app.codecov.io/gh/apache/systemds/pull/2050?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fapache%2Fsysds%2Fruntime%2Fcontrolprogram%2FParForProgramBlock.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3N5c2RzL3J1bnRpbWUvY29udHJvbHByb2dyYW0vUGFyRm9yUHJvZ3JhbUJsb2NrLmphdmE=) | 0.00% | [1 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/systemds/pull/2050?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [.../runtime/controlprogram/caching/CacheableData.java](https://app.codecov.io/gh/apache/systemds/pull/2050?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fapache%2Fsysds%2Fruntime%2Fcontrolprogram%2Fcaching%2FCacheableData.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3N5c2RzL3J1bnRpbWUvY29udHJvbHByb2dyYW0vY2FjaGluZy9DYWNoZWFibGVEYXRhLmphdmE=) | 33.33% | [1 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/systemds/pull/2050?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #2050 +/- ##
============================================
- Coverage 68.84% 68.81% -0.04%
- Complexity 40711 40745 +34
============================================
Files 1440 1440
Lines 161565 161690 +125
Branches 31418 31449 +31
============================================
+ Hits 111232 111266 +34
- Misses 41258 41369 +111
+ Partials 9075 9055 -20
```
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/systemds/pull/2050?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
--
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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
Posted by "phaniarnab (via GitHub)" <gi...@apache.org>.
phaniarnab commented on code in PR #2050:
URL: https://github.com/apache/systemds/pull/2050#discussion_r1682496089
##########
src/test/scripts/gpu/GPUTest.dml:
##########
@@ -0,0 +1,61 @@
+#-------------------------------------------------------------
+#
+# 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.
+#
+#-------------------------------------------------------------
+
+source("src/test/scripts/applications/nn/component/efficientNet.dml") as eff
+
+# Read training data
+data = read($1, format="csv")
+
+N = nrow(data)
+
+# Extract images and labels
+images = data[,2:ncol(data)]
+labels = data[,1]
+
+# Scale images to [0,1], and one-hot encode the labels
+images = images / 255.0
+labels = table(seq(1, N), labels+1, N, 10)
+
+model = eff::initNetwork(1, 10, -1)
+
+# Train
+epochs = 1
+batch_size = 256
+model = eff::netTrain(model, images, 1, 28, 28, labels, epochs, batch_size, 0.025, 0.9, TRUE)
+
+# Also Predict in Batches since otherwise we can run into Memory Issues
+# Could be unnecessary on more powerful machines :)
+iters = ceil(N / batch_size)
+partial_accuracies = matrix(0, rows=iters, cols=1)
+
+parfor(i in 1:iters) {
+ beg = ((i-1) * batch_size) %% N + 1
+ end = min(N, beg + batch_size - 1)
+ X_batch = images[beg:end,]
+ y_batch = labels[beg:end,]
+
+ pred = eff::netPredict(X_batch, model, 1, 28, 28)
+ partial_accuracies[i,1] = mean(rowIndexMax(pred) == rowIndexMax(y_batch))
+}
Review Comment:
This is good. Run it from 10k to 100k mini-batches and plot the execution time. Compare single-gpu parfor and multi-gpu parfor. For one of the data point (e.g., 10k batches), also report the CPU time. Use all the available CPU cores.
--
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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
Posted by "phaniarnab (via GitHub)" <gi...@apache.org>.
phaniarnab commented on PR #2050:
URL: https://github.com/apache/systemds/pull/2050#issuecomment-2241079330
> > @WDRshadow, thanks for putting the numbers here. Did you take an average of 3 runs to capture the execution time? If not, please do that to avoid the JIT compilation and GC overheads. And I assume the numbers reported in this table only measure the total inference time and not the training time.
> > The speedup from 2 GPUs is way less than I expected. Can you explain, why the speedup is not consistently 2x? If you are scoring n images, then each GPU gets n/2 images, which should lead to 2x speedup. I do not anticipate any additional overhead for two GPUs for this use case.
>
> Thanks. Your assumptions are inaccurate. This time is the total execution time, which includes a exactly the same training process before the execution of the `parfor`loop. This is one reason. I am not familiar with `.dml` files and have no time to learn it, so I don't know how to store and read a trained model.
Okay. In that case, try one of the two options: (1) write the model to disk, create separate dml scripts for inference where you read the model and immediately start the parfor loop. You can find plenty of read, write examples in the test scripts and the reproducibility scripts I shared with you. (2) use time() method before and after the parfor and report only the inference time. You can find an example of using time() here: https://github.com/damslab/reproducibility/blob/master/vldb2022-UPLIFT-p2528/FTBench/systemds/T1.dml
For either option, make sure the intermediates are already materialized before the loop starts. SystemDS compiler sometime delays operations till used. You can print the sum of a matrix to force materialization.
--
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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
Posted by "WDRshadow (via GitHub)" <gi...@apache.org>.
WDRshadow commented on PR #2050:
URL: https://github.com/apache/systemds/pull/2050#issuecomment-2242181785
> Okay. Thanks, @WDRshadow, @KexingLi22. Did you manage to set up CUDA version 10.2 in both the GPUs for these experiments? Please make sure the regression tests (github actions) are not failing due to any of your changes. I reran the failed tests.
The driver of GPU and the CUDA version is shared with all GPUs in the same devices. So, yes, both GPUs is set up with CUDA version `10.2`.
--
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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
Posted by "WDRshadow (via GitHub)" <gi...@apache.org>.
WDRshadow commented on code in PR #2050:
URL: https://github.com/apache/systemds/pull/2050#discussion_r1676979385
##########
src/main/java/org/apache/sysds/runtime/controlprogram/caching/CacheableData.java:
##########
@@ -229,7 +229,7 @@ protected CacheableData(DataType dt, ValueType vt) {
_uniqueID = _seq.getNextID();
_cacheStatus = CacheStatus.EMPTY;
_numReadThreads = 0;
- _gpuObjects = DMLScript.USE_ACCELERATOR ? new HashMap<>() : null;
+ _gpuObjects = DMLScript.USE_ACCELERATOR ? new ConcurrentHashMap<>() : null;
Review Comment:
When useing multi-GPU, the size of `_gpuObjects` is large than 2. Then the `ConcurrentModificationError` will be occered. Using `ConcurrentHashMap` could avoid this. Of corse there still some other ways to deal with it. But I think it's the best solusion to avoid copying an extra GPU memory.
--
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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
Posted by "phaniarnab (via GitHub)" <gi...@apache.org>.
phaniarnab commented on PR #2050:
URL: https://github.com/apache/systemds/pull/2050#issuecomment-2242175862
Okay. Thanks, @WDRshadow, @KexingLi22.
Did you manage to set up CUDA version 10.2 in both the GPUs for these experiments?
Please make sure the regression tests (github actions) are not failing due to any of your changes. I reran the failed 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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
Posted by "phaniarnab (via GitHub)" <gi...@apache.org>.
phaniarnab commented on PR #2050:
URL: https://github.com/apache/systemds/pull/2050#issuecomment-2227938544
> > > > Thanks, @WDRshadow, for initiating the project. As discussed before, please experiment with realistic use cases such as parallel scoring and training. You can use our DNN built-ins.
> > >
> > >
> > > Thank you for your comment. My partner @KexingLi22 is writing the test classes. We will see it soon. For DNN testing, we were faced with the awkward situation of not having enough suitable GPUs for testing. As I mentioned above, newer graphics cards can not run on Jcuda `10.2.0`. To be precise, `CUDA 10.2` is not supported by RTX30 series, A100 and newer graphics cards. My test environment lacks older graphics cards. Could you please help us to test in a multi-GPU environment with suitable GPUs after we have written the test classes? Or again, could you provide any testing environment for us?
> >
> >
> > Thanks for clarifying. Unfortunately, at this point, we cannot provide a setup. Once you are done with the project, I can run some performance tests along with our performance test suits. But during the development period, it is not feasible to try every change in our shared node. Without a proper setup of two GPUs, it will be very hard to complete this project. I can offer two possible directions from here:
> >
> > 1. Try running SystemDS on this setup with one GPU at CUDA 10.2 and the other at 11. CUDA 11 has some API differences and may not be able to execute all CUDA methods, but you may still have a functioning system. However, I never tried this myself and unsure about the behavior.
> > 2. Instead of multi-GPU, first implement a multi-stream single-GPU parfor. You need a single GPU with CUDA 10.2. You can use the Jcuda API to create multiple GPU streams, and assign a stream to each parfor thread. This is probably a better alternative.
>
> We got a double RTX2080Ti server and tested scripts in `scripts/nn/example`. Except `AttentionExample` can't recognize the operator `_map` and `Example-MNIST_2NN_Leaky_ReLu_Softmax` can't find the source file `mnist_2NN.dml`, the others can run good. But I know none of them are optimized for multiple GPUs. The only function that is currently optimized for multiple GPUs is `parfor`. We will keep testing the scripts in `src/test/java/org/apache/sysds/test/functions/parfor` and write new test scripts for multi-GPUs cases.
Thanks. You do not have to optimize all NN workloads for multi-GPU. Just implementing a robust parfor support is sufficient for this project.
Please write scoring scenario using parfor. Create a random matrix of test images and take one of the model. For each row, call the forward path from within a parfor, allowing parallel scoring. Store the inferred class in a separate vector. I hope to see some performance improvement of utilizing multiple GPUs.
The parfor tests are not ideal for this project as the operations in those scripts were not targeted for GPUs. You may not see any speedups. However, you can use those tests for unit testing.
Did you verify that you are actually using both the GPUs?
--
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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
Posted by "WDRshadow (via GitHub)" <gi...@apache.org>.
WDRshadow commented on PR #2050:
URL: https://github.com/apache/systemds/pull/2050#issuecomment-2228035321
> > > > > Thanks, @WDRshadow, for initiating the project. As discussed before, please experiment with realistic use cases such as parallel scoring and training. You can use our DNN built-ins.
> > > >
> > > >
> > > > Thank you for your comment. My partner @KexingLi22 is writing the test classes. We will see it soon. For DNN testing, we were faced with the awkward situation of not having enough suitable GPUs for testing. As I mentioned above, newer graphics cards can not run on Jcuda `10.2.0`. To be precise, `CUDA 10.2` is not supported by RTX30 series, A100 and newer graphics cards. My test environment lacks older graphics cards. Could you please help us to test in a multi-GPU environment with suitable GPUs after we have written the test classes? Or again, could you provide any testing environment for us?
> > >
> > >
> > > Thanks for clarifying. Unfortunately, at this point, we cannot provide a setup. Once you are done with the project, I can run some performance tests along with our performance test suits. But during the development period, it is not feasible to try every change in our shared node. Without a proper setup of two GPUs, it will be very hard to complete this project. I can offer two possible directions from here:
> > >
> > > 1. Try running SystemDS on this setup with one GPU at CUDA 10.2 and the other at 11. CUDA 11 has some API differences and may not be able to execute all CUDA methods, but you may still have a functioning system. However, I never tried this myself and unsure about the behavior.
> > > 2. Instead of multi-GPU, first implement a multi-stream single-GPU parfor. You need a single GPU with CUDA 10.2. You can use the Jcuda API to create multiple GPU streams, and assign a stream to each parfor thread. This is probably a better alternative.
> >
> >
> > We got a double RTX2080Ti server and tested scripts in `scripts/nn/example`. Except `AttentionExample` can't recognize the operator `_map` and `Example-MNIST_2NN_Leaky_ReLu_Softmax` can't find the source file `mnist_2NN.dml`, the others can run good. But I know none of them are optimized for multiple GPUs. The only function that is currently optimized for multiple GPUs is `parfor`. We will keep testing the scripts in `src/test/java/org/apache/sysds/test/functions/parfor` and write new test scripts for multi-GPUs cases.
>
> Thanks. You do not have to optimize all NN workloads for multi-GPU. Just implementing a robust parfor support is sufficient for this project. Please write scoring scenario using parfor. Create a random matrix of test images and take one of the model. For each row, call the forward path from within a parfor, allowing parallel scoring. Store the inferred class in a separate vector. I hope to see some performance improvement of utilizing multiple GPUs. The parfor tests are not ideal for this project as the operations in those scripts were not targeted for GPUs. You may not see any speedups. However, you can use those tests for unit testing. Did you verify that you are actually using both the GPUs?
Thanks for the suggestion. It will be helpful for @KexingLi22 writing the test instances.
There is no doubt that SystemDS uses multiple GPUs for the parfor computation. We have used two ways to proof:
1. we have used parfor for multiplication of two 10000*10000 matrices in our simple test case and there is a significant reduction in runtime in case of two GPUs as compared to single GPU.
2. We can clearly see in the java debug environment that in the parallel computation in the `executeLocalParFor` function of the `ParForProgramBlock` class, the `LocalParWorker` and its `Thread` corresponding to the two GPUs take on several computation `Task`s. For a test example, in a matrix math calculation by using `parfor`, the RTX4070 calculated 8 Tasks while the GTX1080 calculated 4.
We'll show about these in our test code.
--
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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
Posted by "phaniarnab (via GitHub)" <gi...@apache.org>.
phaniarnab commented on PR #2050:
URL: https://github.com/apache/systemds/pull/2050#issuecomment-2231958815
> > > > > > Thanks, @WDRshadow, for initiating the project. As discussed before, please experiment with realistic use cases such as parallel scoring and training. You can use our DNN built-ins.
> > > > >
> > > > >
> > > > > Thank you for your comment. My partner @KexingLi22 is writing the test classes. We will see it soon. For DNN testing, we were faced with the awkward situation of not having enough suitable GPUs for testing. As I mentioned above, newer graphics cards can not run on Jcuda `10.2.0`. To be precise, `CUDA 10.2` is not supported by RTX30 series, A100 and newer graphics cards. My test environment lacks older graphics cards. Could you please help us to test in a multi-GPU environment with suitable GPUs after we have written the test classes? Or again, could you provide any testing environment for us?
> > > >
> > > >
> > > > Thanks for clarifying. Unfortunately, at this point, we cannot provide a setup. Once you are done with the project, I can run some performance tests along with our performance test suits. But during the development period, it is not feasible to try every change in our shared node. Without a proper setup of two GPUs, it will be very hard to complete this project. I can offer two possible directions from here:
> > > >
> > > > 1. Try running SystemDS on this setup with one GPU at CUDA 10.2 and the other at 11. CUDA 11 has some API differences and may not be able to execute all CUDA methods, but you may still have a functioning system. However, I never tried this myself and unsure about the behavior.
> > > > 2. Instead of multi-GPU, first implement a multi-stream single-GPU parfor. You need a single GPU with CUDA 10.2. You can use the Jcuda API to create multiple GPU streams, and assign a stream to each parfor thread. This is probably a better alternative.
> > >
> > >
> > > We got a double RTX2080Ti server and tested scripts in `scripts/nn/example`. Except `AttentionExample` can't recognize the operator `_map` and `Example-MNIST_2NN_Leaky_ReLu_Softmax` can't find the source file `mnist_2NN.dml`, the others can run good. But I know none of them are optimized for multiple GPUs. The only function that is currently optimized for multiple GPUs is `parfor`. We will keep testing the scripts in `src/test/java/org/apache/sysds/test/functions/parfor` and write new test scripts for multi-GPUs cases.
> >
> >
> > Thanks. You do not have to optimize all NN workloads for multi-GPU. Just implementing a robust parfor support is sufficient for this project. Please write scoring scenario using parfor. Create a random matrix of test images and take one of the model. For each row, call the forward path from within a parfor, allowing parallel scoring. Store the inferred class in a separate vector. I hope to see some performance improvement of utilizing multiple GPUs. The parfor tests are not ideal for this project as the operations in those scripts were not targeted for GPUs. You may not see any speedups. However, you can use those tests for unit testing. Did you verify that you are actually using both the GPUs?
>
> THanks for your suggestion, @phaniarnab .
>
> We have written a test class MultiGPUTest.java with single GPU test case, MultipleGPU test case to run the script, in which the model EfficientNet was trained and predicts using parfor.
>
> Everything works well and the execute time of singleGPU is 35 sec 121ms, of the multiGPU is 27 sec 378 ms.
>
> And as the advice from @WDRshadow, I also try to add the logger instance into both ParforBody and GPUContext to trace the thread and the GPUContext. And I have already add these into the log4j.properties:
>
> # Enable detailed logging for specific classes
> log4j.logger.org.apache.sysds.runtime.controlprogram.parfor.ParForBody=DEBUG log4j.logger.org.apache.sysds.runtime.instructions.gpu.context.GPUContext=DEBUG
>
> But when I run the test,dml script with the parfor function, nothing about this, which I expected shows out : 24/07/16 10:00:00 DEBUG ParForBody - Thread Thread-1 assigned to GPU context 0
>
> How can I solve this problems?
Thanks. The numbers do not look very good. Train just once and write the model in the disk. In a separate script, read the model and infer the test instances within a parfor loop. Here is an example script [1]. You can even use a randomly initialized model, as we are not measuring the accuracy here. I expect at least a 2x improvement. Vary the test size (i.e., the number of iterations of parfor loop) from 10k to 100k.
First focus on the development, unit testing and experiments. The logger can be delayed. Instead, extend the ParForStatistics class to report the number of GPUs used by the parfor and other relavent details. These will be printed when -stats is passed.
--
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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
Posted by "phaniarnab (via GitHub)" <gi...@apache.org>.
phaniarnab commented on PR #2050:
URL: https://github.com/apache/systemds/pull/2050#issuecomment-2227049404
Thanks, @WDRshadow, for initiating the project.
As discussed before, please experiment with realistic use cases such as parallel scoring and training. You can use our DNN built-ins.
--
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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
Posted by "phaniarnab (via GitHub)" <gi...@apache.org>.
phaniarnab commented on PR #2050:
URL: https://github.com/apache/systemds/pull/2050#issuecomment-2241068566
@WDRshadow, thanks for putting the numbers here.
Did you take an average of 3 runs to capture the execution time? If not, please do that to avoid the JIT compilation and GC overheads. And I assume the numbers reported in this table only measure the total inference time and not the training time.
The speedup from 2 GPUs is way less than I expected. Can you explain, why the speedup is not consistently 2x? If you are scoring n images, then each GPU gets n/2 images, which should lead to 2x speedup. I do not anticipate any additional overhead for two GPUs for this use case.
--
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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
Posted by "WDRshadow (via GitHub)" <gi...@apache.org>.
WDRshadow commented on PR #2050:
URL: https://github.com/apache/systemds/pull/2050#issuecomment-2227913523
> > > Thanks, @WDRshadow, for initiating the project. As discussed before, please experiment with realistic use cases such as parallel scoring and training. You can use our DNN built-ins.
> >
> >
> > Thank you for your comment. My partner @KexingLi22 is writing the test classes. We will see it soon. For DNN testing, we were faced with the awkward situation of not having enough suitable GPUs for testing. As I mentioned above, newer graphics cards can not run on Jcuda `10.2.0`. To be precise, `CUDA 10.2` is not supported by RTX30 series, A100 and newer graphics cards. My test environment lacks older graphics cards. Could you please help us to test in a multi-GPU environment with suitable GPUs after we have written the test classes? Or again, could you provide any testing environment for us?
>
> Thanks for clarifying. Unfortunately, at this point, we cannot provide a setup. Once you are done with the project, I can run some performance tests along with our performance test suits. But during the development period, it is not feasible to try every change in our shared node. Without a proper setup of two GPUs, it will be very hard to complete this project. I can offer two possible directions from here:
>
> 1. Try running SystemDS on this setup with one GPU at CUDA 10.2 and the other at 11. CUDA 11 has some API differences and may not be able to execute all CUDA methods, but you may still have a functioning system. However, I never tried this myself and unsure about the behavior.
> 2. Instead of multi-GPU, first implement a multi-stream single-GPU parfor. You need a single GPU with CUDA 10.2. You can use the Jcuda API to create multiple GPU streams, and assign a stream to each parfor thread. This is probably a better alternative.
We got a double RTX2080Ti server and tested scripts in `scripts/nn/example`. Except `AttentionExample` can't recognize the operator `_map` and `Example-MNIST_2NN_Leaky_ReLu_Softmax` can't find the source file `mnist_2NN.dml`, the others can run good. But I know none of them are optimized for multiple GPUs. The only function that is currently optimized for multiple GPUs is `parfor`. We will keep testing the scripts in `src/test/java/org/apache/sysds/test/functions/parfor` and write new test scripts for multi-GPUs 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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
Posted by "WDRshadow (via GitHub)" <gi...@apache.org>.
WDRshadow commented on PR #2050:
URL: https://github.com/apache/systemds/pull/2050#issuecomment-2241077556
> @WDRshadow, thanks for putting the numbers here. Did you take an average of 3 runs to capture the execution time? If not, please do that to avoid the JIT compilation and GC overheads. And I assume the numbers reported in this table only measure the total inference time and not the training time.
>
> The speedup from 2 GPUs is way less than I expected. Can you explain, why the speedup is not consistently 2x? If you are scoring n images, then each GPU gets n/2 images, which should lead to 2x speedup. I do not anticipate any additional overhead for two GPUs for this use case.
Thanks. Your assumptions are inaccurate. This time is the total execution time, which includes a exactly the same training process before the execution of the `parfor`loop. This is one reason. I am not familiar with `.dml` files and have no time to learn it, so I don't know how to store and read a trained model.
--
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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
Posted by "WDRshadow (via GitHub)" <gi...@apache.org>.
WDRshadow commented on PR #2050:
URL: https://github.com/apache/systemds/pull/2050#issuecomment-2241790721
@phaniarnab We have change our code and test again. The time now is only including `parfor` execution time. The `parfor` is run 3 times and we used the mean time. Here is the record:
| test_id | num_interation | 1_gpu_time_sec | 2_gpu_time_sec | boost_rate |
|:---------------------|-----------------:|----------------------:|----------------------:|----------------------:|
| test01_gpuTest_10k | 10000 | 2.0 | 1.7 | 15% |
| test01_gpuTest_20k | 20000 | 4.0 | 3.0 | 25.0% |
| test01_gpuTest_50k | 50000 | 11.0 | 7.3 | 33.7% |
| test01_gpuTest_100k | 100000 | 22.3 | 15.0 | 32.7% |
| test01_gpuTest_200k | 200000 | 46.0 | 31.3 | 31.9% |
| test01_gpuTest_500k | 500000 | 109.3 | 79.3 | 27.5% |
| Total | 880000 | 194.6 | 137.6 | 29.3% |
### Test environment:
- CPU: `24 vCPU Intel(R) Xeon(R) Platinum 8255C CPU @ 2.50GHz`
- GPU: `RTX2080Ti` * 2
- RAM: `80G`
- OS: `Ubuntu 18.04`
- CUDA: `10.2`
### Comments:
From the table it can be seen that the `boost_rate` does not reach the desired `50%`. This should be due to under-optimisation of `LocalParWorker` or GPU memory management. We have observed the following reasons that may affect multi-GPU optimisation:
1. Multiple GPUs share a storage space with synchronisation locks. For example, `_gpuObjects` stores the caches in each `Task` for the GPUs to read and record the data. Each time a GPU reads that data it will cause blocking.
2. The `TaskPartitioner` design may not be optimal. When the number of `Task` allocations is low in the case of a large amount of data but a small number of `threads`, the single Task calculation will be larger. However, there may be errors in GPU computation, in which case the `Task` needs to be recomputed, consuming more time if that error `Task` is "big". This can be mitigated by improving `Task` allocation.
3. The speedup will improve greatly when multiple GPUs are equally divided into the `Task` and there are no errors in the computation. However, I have observed that in the case of dual graphics cards, one card may execute more `Tasks` than the other.
--
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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [SYSTEMDS-2951] Multi-GPU Support for End-to-End ML Pipelines [systemds]
Posted by "phaniarnab (via GitHub)" <gi...@apache.org>.
phaniarnab commented on PR #2050:
URL: https://github.com/apache/systemds/pull/2050#issuecomment-2243078571
Looks like all tests are passing now.
--
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.
To unsubscribe, e-mail: dev-unsubscribe@systemds.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org