8000 New visibility function by orliac · Pull Request #34 · epfl-radio-astro/bipp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

New visibility function #34

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

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

orliac
Copy link
Collaborator
@orliac orliac commented Nov 4, 2024

This PR to align the 8000 main branch of BIPP with that one used for validating and benchmarking BIPP for the Astro & Computing paper. Apart from the new visibility function introduced in measurement_set.py other commits are the results of investigating inconsistencies between the original Python implementation of BIPP (i.e. Bluebild) and BIPP {SS, NUFF} x {CPU, GPU}, hence it's a bit disparate.

On top of the slides I presented on the 31th May 2024 (ppt, New Visibility Function), I reran a series of tests, among which:

  1. MWA

    IN_DIR=/work/ska/MWA_Solar
    MS_BASENAME_='1133149192-187-188_Sun_10s_cal'; MS_EXT='ms'
    TELESCOPE="MWA"
    TIME_START_IDX=0;   TIME_END_IDX=20
    TIME_SLICE_PE=1;    TIME_SLICE_IM=1;   SORT_TIME=1
    CHANNEL_ID_START=0; CHANNEL_ID_END=19
    

    Results in DP fully equivalent (processing the full dataset).

    #@#IFPE_TVIS (old) 4.202 sec down to (new) 0.893 sec => speedup 4.7

  2. LEAP42rx

    IN_DIR=/work/ska/papers/bipp/data/LEAP_paper
    MS_BASENAME_='RX42_SB100-109.2ch10s'; MS_EXT='ms'
    TELESCOPE="LOFAR"
    TIME_START_IDX=0;   TIME_END_IDX=199
    TIME_SLICE_PE=1;    TIME_SLICE_IM=1;  SORT_TIME=1
    CHANNEL_ID_START=0; CHANNEL_ID_END=19
    

    Results in DP fully equivalent (processing the first 200 epochs and all 20 channels available).

    #@#IFPE_TVIS (old) 31.578 sec down to (new) 2.372 sec => speedup 13.3

  3. OSKAR simulation 9 point sources, 1000 epochs, 4096 channels, 16 TB

    IN_DIR=/scratch/izar/orliac/oskar_simulation_9ps_for_new_ms_visibilities_100ts/oskar/
    MS_BASENAME_='oskar_9ps_SKALOW_512_1000_4096'; MS_EXT='ms'
    TELESCOPE="SKALOW"
    TIME_START_IDX=0;   TIME_END_IDX=10
    TIME_SLICE_PE=1;    TIME_SLICE_IM=1; SORT_TIME=1
    CHANNEL_ID_START=1000; CHANNEL_ID_END=1063
    

    Results in DP fully equivalent (processing the first 10 epochs and 64 channels (1000..1063) among the 4096 available).

    #@#IFPE_TVIS (old) 589.281 sec down to (new) 45.842 sec => speedup 12.9

To enable the new visibility function switch from:

for t, f, S in ms.visibilities(channel_id=channel_ids, time_id=time_id_pe, column="DATA"):
    wl   = constants.speed_of_light / f.to_value(u.Hz)
    XYZ  = ms.instrument(t)
    W    = ms.beamformer(XYZ, wl)
    S, W = measurement_set.filter_data(S, W)
    ...

to

for t, f, S in ms.new_visibilities(channel_id=channel_ids, time_id=time_id_pe, column="DATA"):
    wl   = constants.speed_of_light / f.to_value(u.Hz)
    XYZ  = ms.instrument(t)
    W    = ms.beamformer(XYZ, wl)
    ...

(calls to filter_data are not necessary anymore)

The old and new visibility functions takes two additional arguments:

  1. sort_time boolean, set to True by default, to request sorting the MS entries over time
  2. log_level integer, set to 0 (no logging) by default, to print some information.

Note: processing the MWA dataset revealed a bug in my original implementation of considering the weights from WEIGHT_SPECTRUM when available in the MS. Mainly the sum of weights was overestimated if diagonal values are non zero. Observed differences are small, at the level of the second / third digit.

Example when processing channel 4 of the above mentioned MWA dataset:

New visibility function:

-I- I_filtered_images[lsq]:
 [[[ 12.864439  12.961216  13.057137 ...   1.636401   1.67591    1.714793]
  [ 12.809243  12.905506  13.000877 ...   1.62973    1.669347   1.708355]
  [ 12.755468  12.851212  12.946027 ...   1.623311   1.663019   1.702136]
  ...
  [ 16.127477  16.104703  16.080554 ...   4.115738   4.078333   4.041522]
  [ 16.103664  16.081308  16.057605 ...   4.162355   4.125535   4.089318]
  [ 16.078913  16.056952  16.033674 ...   4.209334   4.173112   4.137499]]

 [[  6.212187   6.212684   6.213074 ...   6.906366   6.876552   6.848255]
  [  6.1856     6.187028   6.188383 ...   6.896811   6.866875   6.838455]
  [  6.159998   6.16232    6.164601 ...   6.887883   6.857755   6.829145]
  ...
  [  7.803834   7.803777   7.804641 ...   8.175439   8.209874   8.245553]
  [  7.803615   7.803992   7.805344 ...   8.155057   8.189585   8.225378]
  [  7.804535   7.805432   7.80735  ...   8.135962   8.170568   8.206453]]

 [[-49.34951  -49.348647 -49.347995 ... -50.579029 -50.596677 -50.614029]
  [-49.369016 -49.368841 -49.368861 ... -50.573134 -50.590766 -50.608144]
  [-49.38915  -49.389682 -49.390388 ... -50.567229 -50.584831 -50.602215]
  ...
  [-47.06736  -47.057345 -47.046924 ... -46.803499 -46.791149 -46.778062]
  [-47.044725 -47.035003 -47.024904 ... -46.789932 -46.777014 -46.763359]
  [-47.022051 -47.012632 -47.002863 ... -46.776032 -46.762532 -46.748296]]] 

Old visibility function:

-I- I_filtered_images[lsq]:
 [[[ 12.862141  12.958901  13.054804 ...   1.636108   1.675611   1.714487]
  [ 12.806955  12.903201  12.998555 ...   1.629439   1.669049   1.70805 ]
  [ 12.75319   12.848917  12.943715 ...   1.623021   1.662722   1.701832]
  ...
  [ 16.124596  16.101827  16.077681 ...   4.115003   4.077604   4.0408  ]
  [ 16.100788  16.078435  16.054736 ...   4.161611   4.124798   4.088587]
  [ 16.076041  16.054084  16.03081  ...   4.208582   4.172366   4.13676 ]]

 [[  6.211078   6.211574   6.211964 ...   6.905132   6.875324   6.847032]
  [  6.184495   6.185923   6.187278 ...   6.895579   6.865648   6.837234]
  [  6.158898   6.161219   6.1635   ...   6.886653   6.856531   6.827925]
  ...
  [  7.80244    7.802383   7.803247 ...   8.173979   8.208407   8.244081]
  [  7.802221   7.802598   7.80395  ...   8.1536     8.188122   8.223909]
  [  7.803141   7.804037   7.805956 ...   8.134509   8.169109   8.204987]]

 [[-49.340695 -49.339833 -49.339181 ... -50.569995 -50.587639 -50.604988]
  [-49.360198 -49.360023 -49.360043 ... -50.564101 -50.58173  -50.599105]
  [-49.380328 -49.380861 -49.381566 ... -50.558197 -50.575796 -50.593177]
  ...
  [-47.058953 -47.04894  -47.038521 ... -46.795139 -46.782791 -46.769706]
  [-47.036322 -47.026602 -47.016504 ... -46.781574 -46.768659 -46.755006]
  [-47.013652 -47.004235 -46.994468 ... -46.767677 -46.75418  -46.739946]]]

Would be good if @shreyamkrishna and @hiboubbouter could check the new visibility function on other datasets (ideally containing a WEIGHT_SPECTRUM column).

@orliac orliac self-assigned this Nov 4, 2024
@@ -50,8 +50,7 @@ auto gram(Queue& q, std::size_t n, const T* x, const T* y, const T* z, T wl, api
const dim3 block(blockSizeX, blockSizeY, 1);
const auto grid = kernel_launch_grid(q.device_prop(), {n, n, 1}, block);

api::launch_kernel(gram_kernel<T>, grid, block, 0, q.stream(), n, x, y, z,
T(2 * 3.14159265358979323846 / wl), g, ldg);
api::launch_kernel(gram_kernel<T>, grid, block, 0, q.stream(), n, x, y, z, wl, g, ldg);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. Maybe make a small PR with this fix, to get this in right away?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done through Bugfix gram gpu #36

…ance issue in the case BIPP is linked to OpenBLAS built with openmp support"

This reverts commit 334cb2d.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0