This project is a Python demonstrator for the stochastic grid bundling method (SGBM) to solve backward stochastic differential equations (BSDE) (see https://arxiv.org/abs/1801.05180), using the particular case of XVA calculation with Black-Scholes model. It makes use of parallel computing with the CUDA Python platform (https://developer.nvidia.com/how-to-cuda-python) to increase the efficiency of the algorithm. While the functions in this project are tailored to the specific problem of XVA, it can be adapted to general Lipschitz BSDEs with proper modification.