Giter VIP home page Giter VIP logo

hpgda-spring22's Introduction

High-Performance Graph & Data Analytics - Spring 2022

Repository for the course High-Performance Graph & Data Analytics at Polimi, Spring 2022

  • cuda_CONTEST contains the source code for the GPU track of the contest. See the readme in the folder for more information.
  • data_struct_CONTEST contains the source code for the graph data structures track of the contest. See the readme in the folder for more information.
  • graph_ml_DEMO contains a python notebook and the input data for a demo where graph machine learning is used to predict links in a protein-protein interaction network. See the readme in the folder for more information.

hpgda-spring22's People

Contributors

gwdidonato avatar andreabosisio avatar

Stargazers

Riccardo Izzo avatar Tianao Ge avatar Ottavia Belotti avatar Mattia Tagliaferri avatar Daniele Ferrazzo avatar  avatar Ole Martin Ruud avatar Daria Preda avatar

Watchers

 avatar Ole Martin Ruud avatar  avatar

hpgda-spring22's Issues

PPR Benchmark not compliant with the contest rules

In the PPR benchmark file, the precision of the results is evaluated through 2 unordered sets.

std::unordered_set<int> top_pr_indices;
std::unordered_set<int> top_pr_golden_indices;

In particular here is where the evaluation happens.

std::cout.precision(old_precision);
// Set intersection to find correctly retrieved vertices;
std::vector<int> correctly_retrieved_vertices;
set_intersection(top_pr_indices.begin(), top_pr_indices.end(), top_pr_golden_indices.begin(), top_pr_golden_indices.end(), std::back_inserter(correctly_retrieved_vertices));
precision = double(correctly_retrieved_vertices.size()) / topk;
if (debug) std::cout << "correctly retrived top-" << topk << " vertices=" << correctly_retrieved_vertices.size() << " (" << 100 * precision << "%)" << std::endl;

The problem I encountered is related to the set_intersection method, which, in this case, to work properly should receive 2 ordered sets (standard c++ sets), because set_intersection expects both sets sorted, otherwise the intersection takes into account the "raw" order of the topK nodes, differently from what stated in the rules.

Here are the results obtained using unordered_set:

Schermata 2022-06-20 alle 18 08 53

Using sets no wrong precision computation occurs.

Possible inconsistency in spmv_coo_cpu

Hi, is it possible that here at line 39 x and y should be swapped when the read_tuples_transposed flag is set to true? According me and @feDann they should be swapped because when the flag is set to true, x holds the column ids and y holds the row ids.

inline void spmv_coo_cpu(const int *x, const int *y, const double *val, const double *vec, double *result, int N) {
for (int i = 0; i < N; i++) {
result[x[i]] += val[i] * vec[y[i]];
}
}

read_mtx(graph_file_path.c_str(), &x, &y, &val,
&num_rows, &num_columns, &E, // Store the number of vertices (row and columns must be the same value), and edges;
true, // If true, read edges TRANSPOSED, i.e. edge (2, 3) is loaded as (3, 2). We set this true as it simplifies the PPR computation;
false, // If true, read the third column of the matrix file. If false, set all values to 1 (this is what you want when reading a graph topology);
debug,
false, // MTX files use indices starting from 1. If for whatever reason your MTX files uses indices that start from 0, set zero_indexed_file=true;
true // If true, sort the edges in (x, y) order. If you have a sorted MTX file, turn this to false to make loading faster;
);

[CUDA][BUG] Precision not correctly updated when debug=false

HI, i noticed that when i run the executable without the -d flag even if the -c flag is present the cpu_validation function is never called so the gpu_result column of the csv is always to zero. This happens only for the ppr implementation because the actual value of the precision is updated inside the cpu_validation function

precision = double(correctly_retrieved_vertices.size()) / topk;

A possible solution could be to move line 84 outside the if statement and also modify the cpu_validation function to print line 136 only if debug=true:

if (debug) {
std::cout << " GPU execution(" << i << ")=" << float(exec_time) / 1000 << " ms" << std::endl;
std::cout << " GPU result=" << print_result() << std::endl;
if (do_cpu_validation) cpu_validation(i);
} else {
std::cout << i << "," << print_result(true) << "," << float(reset_time + exec_time) / 1e6 << "," << float(reset_time) / 1e6 << "," << float(exec_time) / 1e6 << std::endl;
}
}

std::cout << "exec time CPU=" << double(exec_time) / 1000 << " ms" << std::endl;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.