-
Notifications
You must be signed in to change notification settings - Fork 461
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYSTEMDS-2760] Transpose micro benchmark
This micro benchmark considers multiple cases, tallskinny, shortwide and "normal" matrices. It gives an indication of if the transpose is parallelizing and using the hardware appropriately.
- Loading branch information
1 parent
3ce3270
commit a465e54
Showing
6 changed files
with
199 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
#!/usr/bin/env bash | ||
#------------------------------------------------------------- | ||
# | ||
# 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. | ||
# | ||
#------------------------------------------------------------- | ||
|
||
# Set properties | ||
export LOG4JPROP='scripts/perftest/conf/log4j-off.properties' | ||
export SYSDS_QUIET=1 | ||
export SYSTEMDS_ROOT=$(pwd) | ||
export PATH=$SYSTEMDS_ROOT/bin:$PATH | ||
|
||
export SYSTEMDS_STANDALONE_OPTS="-Xmx20g -Xms20g -Xmn2000m" | ||
|
||
mkdir -p 'scripts/perftest/results' | ||
|
||
repeatScript=5 | ||
methodRepeat=5 | ||
sparsities=("1.0 0.1") | ||
|
||
for s in $sparsities; do | ||
|
||
LogName="scripts/perftest/results/transpose-skinny-$s.log" | ||
rm -f $LogName | ||
|
||
# Baseline | ||
perf stat -d -d -d -r $repeatScript \ | ||
systemds scripts/perftest/scripts/transpose.dml \ | ||
-config scripts/perftest/conf/std.xml \ | ||
-stats \ | ||
-args 2500000 50 $s $methodRepeat \ | ||
>>$LogName 2>&1 | ||
|
||
echo $LogName | ||
cat $LogName | grep -E ' r. |Total elapsed time|-----------| instructions | cycles | CPUs utilized ' | tee $LogName.log | ||
|
||
LogName="scripts/perftest/results/transpose-wide-$s.log" | ||
rm -f $LogName | ||
|
||
# Baseline | ||
perf stat -d -d -d -r $repeatScript \ | ||
systemds scripts/perftest/scripts/transpose.dml \ | ||
-config scripts/perftest/conf/std.xml \ | ||
-stats \ | ||
-args 50 2500000 $s $methodRepeat \ | ||
>>$LogName 2>&1 | ||
|
||
echo $LogName | ||
cat $LogName | grep -E ' r. |Total elapsed time|-----------| instructions | cycles | CPUs utilized ' | tee $LogName.log | ||
|
||
LogName="scripts/perftest/results/transpose-full-$s.log" | ||
rm -f $LogName | ||
|
||
# Baseline | ||
perf stat -d -d -d -r $repeatScript \ | ||
systemds scripts/perftest/scripts/transpose.dml \ | ||
-config scripts/perftest/conf/std.xml \ | ||
-stats \ | ||
-args 20000 5000 $s $methodRepeat \ | ||
>>$LogName 2>&1 | ||
|
||
echo $LogName | ||
cat $LogName | grep -E ' r. |Total elapsed time|-----------| instructions | cycles | CPUs utilized ' | tee $LogName.log | ||
done | ||
|
||
LogName="scripts/perftest/results/transpose-large.log" | ||
rm -f $LogName | ||
# Baseline | ||
perf stat -d -d -d -r $repeatScript \ | ||
systemds scripts/perftest/scripts/transpose.dml \ | ||
-config scripts/perftest/conf/std.xml \ | ||
-stats \ | ||
-args 15000000 30 0.8 $methodRepeat \ | ||
>>$LogName 2>&1 | ||
|
||
echo $LogName | ||
cat $LogName | grep -E ' r. |Total elapsed time|-----------| instructions | cycles | CPUs utilized ' | tee $LogName.log | ||
|
||
########################### | ||
## From disk experiment: | ||
########################### | ||
|
||
repeatScript=2 | ||
methodRepeat=2 | ||
|
||
LogName="scripts/perftest/results/transpose-large-fromdisk.log" | ||
rm -f $LogName | ||
|
||
if [[ ! -f "scripts/perftest/in/transposeIn.data.mtd" ]]; then | ||
systemds scripts/perftest/scripts/write.dml \ | ||
-config scripts/perftest/conf/std.xml \ | ||
-args 15000000 30 0.8 "scripts/perftest/in/transposeIn.data" \ | ||
>>/dev/null 2>&1 | ||
fi | ||
|
||
perf stat -d -d -d -r $repeatScript \ | ||
systemds scripts/perftest/scripts/transposeFromDisk.dml \ | ||
-config scripts/perftest/conf/std.xml \ | ||
-stats \ | ||
-args "scripts/perftest/in/transposeIn.data" $methodRepeat \ | ||
>>$LogName 2>&1 | ||
|
||
echo $LogName | ||
cat $LogName | grep -E ' r. |Total elapsed time|-----------| instructions | cycles | CPUs utilized ' | tee $LogName.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#------------------------------------------------------------- | ||
# | ||
# 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. | ||
# | ||
#------------------------------------------------------------- | ||
|
||
x = rand(rows=$1, cols=$2, min= 0.0, max= 1.0, sparsity=$3, seed= 12) | ||
for(i in 1:$4) { | ||
res = t(x) | ||
} | ||
print(sum(res)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#------------------------------------------------------------- | ||
# | ||
# 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. | ||
# | ||
#------------------------------------------------------------- | ||
|
||
x = read($1) | ||
print(sum(x)) # Sum here to force read time into the sum operator | ||
for(i in 1:$2) { | ||
res = t(x) | ||
} | ||
print(sum(res)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
# | ||
#------------------------------------------------------------- | ||
|
||
x = rand(rows=$1, cols=$2, min= 0.0, max= 1.0, sparsity=$3, seed= 12) | ||
write(x,$4, format="binary") |