Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYSTEMDS-2760] Transpose micro benchmark #1127

Closed
wants to merge 2 commits into from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -112,4 +112,5 @@ src/main/cpp/bin
*.dmlt

# Performance Test artifacts
scripts/perftest/results
scripts/perftest/results
scripts/perftest/in
95 changes: 95 additions & 0 deletions scripts/perftest/MatrixTranspose.sh
@@ -0,0 +1,95 @@
#!/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


1 change: 1 addition & 0 deletions scripts/perftest/runAll.sh
Expand Up @@ -24,6 +24,7 @@
# Micro Benchmarks:

./scripts/perftest/MatrixMult.sh
./scripts/perftest/MatrixTranspose.sh

# Algorithms Benchmarks:

26 changes: 26 additions & 0 deletions scripts/perftest/scripts/transpose.dml
@@ -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))