Closed DeepBlockDeepak closed 1 year ago
@DeepBlockDeepak This is a great start!
Here are some questions/suggestions:
ktensor
for the import?tensor
to something that is not a pyttb
class.cp_algorithms_profiling.ipynb
file.tucker_algorithms_profiling.ipynb
.cp_apr
should include only the *integer*
files. See data/README.md regarding this. If cp_apr
tries to run on the *continuous*
files without error, this should be submitted as an Issue. Only nonnegative integer data should be modeled via cp_apr
.Thanks!
/tests/data/*.tns
files (without any input validation), but forgot to remove the ktensor check once you supplied the /profiling/data/
directory.Looking good!
Here are some suggestions:
stoptol
, maxiters
, maxinneriters
(where available)algorithm
choices in cp_apr
: mu
(default), pqnr
, pdnr
Latest commit includes a new file cp_and_tucker_algorithms_profiling_with_gprof2dot.ipynb
where the profiling stats are created in a generated sub-directory /profiling/pstats_files
.
profile(test_files, ranks, "hosvd", tol=1e-4)
is executed in the notebook, the data-input file tensor_dense_integer_size_1000_3_3_rng_1.tns
will be used during computation at some point. The resulting profile stats will be created and saved as ./pstats_files/tensor_dense_integer_size_1000_3_3_rng_1_hosvd.pstats
relative to our notebook's location. Notice that the last part of the basename of that filepath includes a reference to the algorithm that was used.
cp_als()
uses the same input tensor file, the resulting profile stats are saved like: ./pstats_files/tensor_dense_integer_size_1000_3_3_rng_1_cp_als.pstats
./profiling
directory, then running the following command in Terminal (swap out appropriate algo name for the var algorithm
below):algorithm=<specific_algorithm_name>
mkdir -p gprof2dot_images/${algorithm}
for file in pstats_files/${algorithm}/*.pstats; do
gprof2dot -f pstats $file \
| dot -Tpng -o gprof2dot_images/${algorithm}/$(basename $file .pstats).png
done
This generates the /profiling/gprof2dot_images
directory, where the created .png profile visuals are stored. I believe I had to install both graphviz
to my system and package install gprof2dot
beforehand, a la this introduction.
The current visual profiling output is the result the pstats from testing with cell 11 : profile(test_files, ranks, "tucker_als")
.
@DeepBlockDeepak Can you add the profiling output with images for all 4 algorithms?
@dmdunla The images exist inside of /profiling/gprof2dot_images/<algo_name>
per each algorithm.
Preliminary profiler notebook within
/profiling
, which displays top 10 slowest function calls as they occur in eithercp_als()
orcp_apr()
, depending on which algorithm the user wants to test. Theranks
list is looped over to test the functions with tensors of ranks 2,3 and finally 4. The data for the tests is read from/profiling/data/*.tns
.To test
The bottom code block allows you to choose which algorithm to test. At the moment,
cp_apr
takes ~5m30s whilecp_als
takes about 10s.:books: Documentation preview :books:: https://pyttb--199.org.readthedocs.build/en/199/