René's URL Explorer Experiment


Title: WIP: interface for map-reduce style kernels by Hardcode84 · Pull Request #284 · IntelPython/sdc · GitHub

Open Graph Title: WIP: interface for map-reduce style kernels by Hardcode84 · Pull Request #284 · IntelPython/sdc

X Title: WIP: interface for map-reduce style kernels by Hardcode84 · Pull Request #284 · IntelPython/sdc

Description: This PR adds new APIs to be used by pandas functions implementers to help parallelize theirs kernels: map_reduce(arg, init_val, map_func, reduce_func) map_reduce_chunked(arg, init_val, map_func, reduce_func) Parameters: arg - list-like object (it can be python list, numpy array or any other object with similar interface) init_val - initial value map_func - map function which will be applied to each element/elements range in parallel (on different processes of on different nodes) reduce_func - reduction function to combine initial value and results from different processes/nodes The difference between these two functions: map_reduce will apply map function to each element in range (map function must take single element and return single element) and then apply reduce function pairwise (reduce function must take two elements and return single element) map_reduce_chunked will apply map function to range of elements, belonging to current thread/node (map function must take range of elements as paramenter and return list/array as result) and then apply reduce to entire ranges (reduce function must take two ranges as parameters and return list/array) You can also call any of these functions from inside map or reduce func to support nested parallelism. These functions usable for both thread/mpi parallelism. If you call them from numba @njit function they will be parallelized by numba buiilt-in parallelisation machinery. If you call them from @hpat.jit they will be distributed by hpat parallelisation pass (doesn't work currently) Wrote parallel series sorting (numpy.sort + hand-written merge) as example. Current issues: Thread parallel sort isn't working due to numba issue numba/numba#4806 MPI parallelisation doesn't work entirely (lot of issues, bigger one is that hpat support only very limited list of built-in functions (sum, mult, min, max) for parfor reductions) Parallel sort handles NaNs differently from numpy.sort, need to fix Threads/nodes count in map_reduce_chunked handcode as 4, will fix Proper documentation The second part of this PR is distribution depth knob to (not-so)fine-tune nested parallelism between distribution and threading: New environment variable SDC_DISTRIBUTION_DEPTH controls how much nested parallel loops will be distributed by DistributionPass Distributed loops are any of newly introduced map_reduce* functions or manually written prange loops. Default value is 1 which means that only the most outer loop will be distributed by mpi, then next loop will parallelised by numba, and then all deeper loops will be executed sequentually (as numba doesn't support nested parallelisation) Set SDC_DISTRIBUTION_DEPTH to 0 to disable distribution. # SDC_DISTRIBUTION_DEPTH=1 for i in prange(I) # distributed by DistributedPass for j in prange(J) # parallelised by numba for k in prange(K) # executed sequentually

Open Graph Description: This PR adds new APIs to be used by pandas functions implementers to help parallelize theirs kernels: map_reduce(arg, init_val, map_func, reduce_func) map_reduce_chunked(arg, init_val, map_func, r...

X Description: This PR adds new APIs to be used by pandas functions implementers to help parallelize theirs kernels: map_reduce(arg, init_val, map_func, reduce_func) map_reduce_chunked(arg, init_val, map_func, r...

Opengraph URL: https://github.com/IntelPython/sdc/pull/284

X: @github

direct link

Domain: patch-diff.githubusercontent.com

route-pattern/:user_id/:repository/pull/:id/checks(.:format)
route-controllerpull_requests
route-actionchecks
fetch-noncev2:34ac0e73-4652-4f2d-d121-7ab6e87e86d9
current-catalog-service-hash87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a
request-idE038:338AF6:78220DB:9D094EE:696DB514
html-safe-nonce6decd878bd28fb4c6f7696e236efc97f7e927b4215c55d474ef7f44e5e70ddd8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMDM4OjMzOEFGNjo3ODIyMERCOjlEMDk0RUU6Njk2REI1MTQiLCJ2aXNpdG9yX2lkIjoiNjU2NTY5Nzg5Mjc3NTczNjU5NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc74a0ef2d64137a715d540d1a7303354612945a34d62f0fa1ae816d13bd543d8
hovercard-subject-tagpull_request:339834193
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/checks
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/IntelPython/sdc/pull/284/checks
twitter:imagehttps://avatars.githubusercontent.com/u/3274859?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/3274859?s=400&v=4
og:image:altThis PR adds new APIs to be used by pandas functions implementers to help parallelize theirs kernels: map_reduce(arg, init_val, map_func, reduce_func) map_reduce_chunked(arg, init_val, map_func, r...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None4922b452d03cd8dbce479d866a11bc25b59ef6ee2da23aa9b0ddefa6bd4d0064
turbo-cache-controlno-preview
go-importgithub.com/IntelPython/sdc git https://github.com/IntelPython/sdc.git
octolytics-dimension-user_id20491374
octolytics-dimension-user_loginIntelPython
octolytics-dimension-repository_id93080202
octolytics-dimension-repository_nwoIntelPython/sdc
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id93080202
octolytics-dimension-repository_network_root_nwoIntelPython/sdc
turbo-body-classeslogged-out env-production page-responsive full-width full-width-p-0
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7e5ae23c70136152637ceee8d6faceb35596ec46
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/IntelPython/sdc/pull/284/checks#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FIntelPython%2Fsdc%2Fpull%2F284%2Fchecks
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FIntelPython%2Fsdc%2Fpull%2F284%2Fchecks
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Fchecks&source=header-repo&source_repo=IntelPython%2Fsdc
Reloadhttps://patch-diff.githubusercontent.com/IntelPython/sdc/pull/284/checks
Reloadhttps://patch-diff.githubusercontent.com/IntelPython/sdc/pull/284/checks
Reloadhttps://patch-diff.githubusercontent.com/IntelPython/sdc/pull/284/checks
IntelPython https://patch-diff.githubusercontent.com/IntelPython
sdchttps://patch-diff.githubusercontent.com/IntelPython/sdc
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2FIntelPython%2Fsdc
Fork 62 https://patch-diff.githubusercontent.com/login?return_to=%2FIntelPython%2Fsdc
Star 642 https://patch-diff.githubusercontent.com/login?return_to=%2FIntelPython%2Fsdc
Code https://patch-diff.githubusercontent.com/IntelPython/sdc
Issues 37 https://patch-diff.githubusercontent.com/IntelPython/sdc/issues
Pull requests 20 https://patch-diff.githubusercontent.com/IntelPython/sdc/pulls
Discussions https://patch-diff.githubusercontent.com/IntelPython/sdc/discussions
Actions https://patch-diff.githubusercontent.com/IntelPython/sdc/actions
Projects 0 https://patch-diff.githubusercontent.com/IntelPython/sdc/projects
Security Uh oh! There was an error while loading. Please reload this page. https://patch-diff.githubusercontent.com/IntelPython/sdc/security
Please reload this pagehttps://patch-diff.githubusercontent.com/IntelPython/sdc/pull/284/checks
Insights https://patch-diff.githubusercontent.com/IntelPython/sdc/pulse
Code https://patch-diff.githubusercontent.com/IntelPython/sdc
Issues https://patch-diff.githubusercontent.com/IntelPython/sdc/issues
Pull requests https://patch-diff.githubusercontent.com/IntelPython/sdc/pulls
Discussions https://patch-diff.githubusercontent.com/IntelPython/sdc/discussions
Actions https://patch-diff.githubusercontent.com/IntelPython/sdc/actions
Projects https://patch-diff.githubusercontent.com/IntelPython/sdc/projects
Security https://patch-diff.githubusercontent.com/IntelPython/sdc/security
Insights https://patch-diff.githubusercontent.com/IntelPython/sdc/pulse
Hardcode84https://patch-diff.githubusercontent.com/Hardcode84
IntelPython:masterhttps://patch-diff.githubusercontent.com/IntelPython/sdc/tree/master
Hardcode84:dist_refachttps://patch-diff.githubusercontent.com/Hardcode84/hpat/tree/dist_refac
Conversation 2 https://patch-diff.githubusercontent.com/IntelPython/sdc/pull/284
Commits 11 https://patch-diff.githubusercontent.com/IntelPython/sdc/pull/284/commits
Checks 0 https://patch-diff.githubusercontent.com/IntelPython/sdc/pull/284/checks
Files changed https://patch-diff.githubusercontent.com/IntelPython/sdc/pull/284/files
Please reload this pagehttps://patch-diff.githubusercontent.com/IntelPython/sdc/pull/284/checks
Please reload this pagehttps://patch-diff.githubusercontent.com/IntelPython/sdc/pull/284/checks
WIP: interface for map-reduce style kernels https://patch-diff.githubusercontent.com/IntelPython/sdc/pull/284/checks#top
Please reload this pagehttps://patch-diff.githubusercontent.com/IntelPython/sdc/pull/284/checks
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.