we updated our version of CTF and were having some issues with regard
to the performance of the slicing in our code.
After some sniffing around we found this line in the slice method.
In version 1.4.1 the if statement had the < operator in it.
Some time after that this was changed into <= which according to my
understanding renders the else codeblock useless, i.e.
This means that when the number of processors where tsr_B is
distributed among is equal to tsr_A, there is also a checking of the
dimensions and padding for A, and this means that CTF has to read
the data from A,
If this is true, this pull request would be a fix to the problem. We have
certainly tested it and it confirmed our suspicion. For slices of big tensors
the difference between the < and the <= version is up to 50% in time,
according to our benchmarks. However, for small tensors it appears to be
roughly equivalent, which makes sense.
These changes seem to make the python tests fail though, likely due to some subtleties involving sparsity, so I will need to investigate/adjust a bit before merging.
Hello,
we updated our version of
CTF
and were having some issues with regard to the performance of the slicing in our code.After some sniffing around we found this line in the slice method. In version
1.4.1
theif
statement had the<
operator in it. Some time after that this was changed into<=
which according to my understanding renders theelse
codeblock useless, i.e.This means that when the number of processors where
tsr_B
is distributed among is equal totsr_A
, there is also a checking of the dimensions and padding forA
, and this means thatCTF
has to read the data fromA
,which makes this block slower.
If this is true, this pull request would be a fix to the problem. We have certainly tested it and it confirmed our suspicion. For slices of big tensors the difference between the
<
and the<=
version is up to50%
in time, according to our benchmarks. However, for small tensors it appears to be roughly equivalent, which makes sense.Thank you very much for your great project!