{"id":12781,"date":"2019-04-03T05:00:33","date_gmt":"2019-04-03T12:00:33","guid":{"rendered":"https:\/\/engineering.fb.com\/?p=12781"},"modified":"2020-03-23T21:27:11","modified_gmt":"2020-03-24T04:27:11","slug":"pytorch-biggraph","status":"publish","type":"post","link":"https:\/\/engineering.fb.com\/2019\/04\/03\/open-source\/pytorch-biggraph\/","title":{"rendered":"PyTorch-BigGraph: Faster embeddings of extremely large graphs"},"content":{"rendered":"<h2><b>WHAT IT IS:<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">A new tool from Facebook AI Research that enables training of multi-relation graph embeddings for very large graphs. <\/span><a href=\"https:\/\/github.com\/facebookresearch\/PyTorch-BigGraph\"><span style=\"font-weight: 400;\">PyTorch-BigGraph<\/span><\/a><span style=\"font-weight: 400;\"> (PBG) handles graphs with billions of nodes and trillions of edges. Since PBG is written in <\/span><a href=\"https:\/\/ai.facebook.com\/blog\/pytorch-10-stable-release-now-available\/\"><span style=\"font-weight: 400;\">PyTorch<\/span><\/a><span style=\"font-weight: 400;\">, researchers and engineers can easily swap in their own loss functions, models, and other components. <\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><a href=\"https:\/\/ai.facebook.com\/blog\/open-sourcing-pytorch-biggraph-for-faster-embeddings-of-extremely-large-graphs\"><span style=\"font-weight: 400;\">Read more on our AI blog about PBG and our first published embeddings.<\/span><\/a><\/p>\n<h2><b>WHAT IT DOES:<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Engineers can generate embeddings of nodes in a graph (knowledge graphs, graphs of stock transactions, online content, etc.) without specialized computing resources like multiple GPUs or huge amounts of memory. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">PBG takes as input a graph data set in the form of a list of edges. Each edge consists of a source node, a destination node, and an optional relation type. PBG shards the nodes and edges, performs training on multiple threads (on a single machine or multiple machines in parallel), and then outputs a list of embeddings, one per unique node ID in the edgelist.<\/span><span style=\"font-weight: 400;\"> These embeddings can then be used as inputs for a variety of tasks, such as feeding them into <a href=\"https:\/\/github.com\/facebookresearch\/faiss\">FAISS<\/a> to perform fast nearest-neighbor search at large scale.\u00a0<\/span><\/p>\n<h2><b>WHY IT MATTERS:<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Embeddings are an important unsupervised approach in AI. Many practitioners have large graphs with multiple relation types and multiple entity types. Graph embeddings allow them to turn that data into something usable by an ML algorithm. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">PBG scales graph embedding algorithms from the literature to extremely large graphs. Compared with commonly used embedding software, PBG is robust, scalable, and highly optimized. It is often orders of magnitude faster, and it produces embeddings of comparable quality to state-of-the-art models on standard benchmarks. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">We hope that PBG will be a useful tool for researchers, smaller companies, and organizations that may have large graph data sets but lack the tools to efficiently apply this data to their ML applications. We encourage developers to release and experiment with larger data sets and hope that unsupervised learning on massive graphs may eventually lead to better algorithms for inference on graph structured data.<\/span><\/p>\n<h2><b>GET IT ON GITHUB:<\/b><\/h2>\n<p><a href=\"https:\/\/github.com\/facebookresearch\/PyTorch-BigGraph\"><span style=\"font-weight: 400;\">PyTorch-BigGraph<\/span><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>WHAT IT IS: A new tool from Facebook AI Research that enables training of multi-relation graph embeddings for very large graphs. PyTorch-BigGraph (PBG) handles graphs with billions of nodes and trillions of edges. Since PBG is written in PyTorch, researchers and engineers can easily swap in their own loss functions, models, and other components. Read [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"https:\/\/engineering.fb.com\/2019\/04\/03\/open-source\/pytorch-biggraph\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":12,"featured_media":12502,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[73,72,174],"tags":[194],"coauthors":[389],"class_list":["post-12781","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-research","category-ml-applications","category-open-source","tag-open-source-in-brief","fb_content_type-article"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v19.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>PyTorch-BigGraph: Faster embeddings of large graphs - Engineering at Meta<\/title>\n<meta name=\"description\" content=\"A new tool from FAIR, PyTorch-BigGraph enables training of multi-relation graph embeddings for graphs with billions of nodes and trillions of edges.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/engineering.fb.com\/2019\/04\/03\/open-source\/pytorch-biggraph\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Import User\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/engineering.fb.com\\\/2019\\\/04\\\/03\\\/open-source\\\/pytorch-biggraph\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/engineering.fb.com\\\/2019\\\/04\\\/03\\\/open-source\\\/pytorch-biggraph\\\/\"},\"author\":{\"@id\":\"https:\\\/\\\/engineering.fb.com\\\/2019\\\/04\\\/03\\\/open-source\\\/pytorch-biggraph\\\/#author\",\"name\":\"\"},\"headline\":\"PyTorch-BigGraph: Faster embeddings of extremely large graphs\",\"datePublished\":\"2019-04-03T12:00:33+00:00\",\"dateModified\":\"2020-03-24T04:27:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/engineering.fb.com\\\/2019\\\/04\\\/03\\\/open-source\\\/pytorch-biggraph\\\/\"},\"wordCount\":355,\"publisher\":{\"@id\":\"https:\\\/\\\/engineering.fb.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/engineering.fb.com\\\/2019\\\/04\\\/03\\\/open-source\\\/pytorch-biggraph\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/engineering.fb.com\\\/wp-content\\\/uploads\\\/2019\\\/02\\\/OSIBgreen.jpg\",\"keywords\":[\"Open Source in Brief\"],\"articleSection\":[\"AI Research\",\"ML Applications\",\"Open Source\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/engineering.fb.com\\\/2019\\\/04\\\/03\\\/open-source\\\/pytorch-biggraph\\\/\",\"url\":\"https:\\\/\\\/engineering.fb.com\\\/2019\\\/04\\\/03\\\/open-source\\\/pytorch-biggraph\\\/\",\"name\":\"PyTorch-BigGraph: Faster embeddings of large graphs - Engineering at Meta\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/engineering.fb.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/engineering.fb.com\\\/2019\\\/04\\\/03\\\/open-source\\\/pytorch-biggraph\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/engineering.fb.com\\\/2019\\\/04\\\/03\\\/open-source\\\/pytorch-biggraph\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/engineering.fb.com\\\/wp-content\\\/uploads\\\/2019\\\/02\\\/OSIBgreen.jpg\",\"datePublished\":\"2019-04-03T12:00:33+00:00\",\"dateModified\":\"2020-03-24T04:27:11+00:00\",\"description\":\"A new tool from FAIR, PyTorch-BigGraph enables training of multi-relation graph embeddings for graphs with billions of nodes and trillions of edges.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/engineering.fb.com\\\/2019\\\/04\\\/03\\\/open-source\\\/pytorch-biggraph\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/engineering.fb.com\\\/2019\\\/04\\\/03\\\/open-source\\\/pytorch-biggraph\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/engineering.fb.com\\\/2019\\\/04\\\/03\\\/open-source\\\/pytorch-biggraph\\\/#primaryimage\",\"url\":\"https:\\\/\\\/engineering.fb.com\\\/wp-content\\\/uploads\\\/2019\\\/02\\\/OSIBgreen.jpg\",\"contentUrl\":\"https:\\\/\\\/engineering.fb.com\\\/wp-content\\\/uploads\\\/2019\\\/02\\\/OSIBgreen.jpg\",\"width\":1920,\"height\":1080,\"caption\":\"PyTorch-BigGraph: Faster embeddings of extremely large graphs\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/engineering.fb.com\\\/2019\\\/04\\\/03\\\/open-source\\\/pytorch-biggraph\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/engineering.fb.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PyTorch-BigGraph: Faster embeddings of extremely large graphs\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/engineering.fb.com\\\/#website\",\"url\":\"https:\\\/\\\/engineering.fb.com\\\/\",\"name\":\"Engineering at Meta\",\"description\":\"Engineering at Meta Blog\",\"publisher\":{\"@id\":\"https:\\\/\\\/engineering.fb.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/engineering.fb.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/engineering.fb.com\\\/#organization\",\"name\":\"Meta\",\"url\":\"https:\\\/\\\/engineering.fb.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/engineering.fb.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/engineering.fb.com\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/Meta_lockup_positive-primary_RGB.jpg\",\"contentUrl\":\"https:\\\/\\\/engineering.fb.com\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/Meta_lockup_positive-primary_RGB.jpg\",\"width\":29011,\"height\":12501,\"caption\":\"Meta\"},\"image\":{\"@id\":\"https:\\\/\\\/engineering.fb.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Engineering\\\/\",\"https:\\\/\\\/x.com\\\/fb_engineering\"]},[]]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"PyTorch-BigGraph: Faster embeddings of large graphs - Engineering at Meta","description":"A new tool from FAIR, PyTorch-BigGraph enables training of multi-relation graph embeddings for graphs with billions of nodes and trillions of edges.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/engineering.fb.com\/2019\/04\/03\/open-source\/pytorch-biggraph\/","twitter_misc":{"Written by":"Import User","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/engineering.fb.com\/2019\/04\/03\/open-source\/pytorch-biggraph\/#article","isPartOf":{"@id":"https:\/\/engineering.fb.com\/2019\/04\/03\/open-source\/pytorch-biggraph\/"},"author":{"@id":"https:\/\/engineering.fb.com\/2019\/04\/03\/open-source\/pytorch-biggraph\/#author","name":""},"headline":"PyTorch-BigGraph: Faster embeddings of extremely large graphs","datePublished":"2019-04-03T12:00:33+00:00","dateModified":"2020-03-24T04:27:11+00:00","mainEntityOfPage":{"@id":"https:\/\/engineering.fb.com\/2019\/04\/03\/open-source\/pytorch-biggraph\/"},"wordCount":355,"publisher":{"@id":"https:\/\/engineering.fb.com\/#organization"},"image":{"@id":"https:\/\/engineering.fb.com\/2019\/04\/03\/open-source\/pytorch-biggraph\/#primaryimage"},"thumbnailUrl":"https:\/\/engineering.fb.com\/wp-content\/uploads\/2019\/02\/OSIBgreen.jpg","keywords":["Open Source in Brief"],"articleSection":["AI Research","ML Applications","Open Source"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/engineering.fb.com\/2019\/04\/03\/open-source\/pytorch-biggraph\/","url":"https:\/\/engineering.fb.com\/2019\/04\/03\/open-source\/pytorch-biggraph\/","name":"PyTorch-BigGraph: Faster embeddings of large graphs - Engineering at Meta","isPartOf":{"@id":"https:\/\/engineering.fb.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/engineering.fb.com\/2019\/04\/03\/open-source\/pytorch-biggraph\/#primaryimage"},"image":{"@id":"https:\/\/engineering.fb.com\/2019\/04\/03\/open-source\/pytorch-biggraph\/#primaryimage"},"thumbnailUrl":"https:\/\/engineering.fb.com\/wp-content\/uploads\/2019\/02\/OSIBgreen.jpg","datePublished":"2019-04-03T12:00:33+00:00","dateModified":"2020-03-24T04:27:11+00:00","description":"A new tool from FAIR, PyTorch-BigGraph enables training of multi-relation graph embeddings for graphs with billions of nodes and trillions of edges.","breadcrumb":{"@id":"https:\/\/engineering.fb.com\/2019\/04\/03\/open-source\/pytorch-biggraph\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/engineering.fb.com\/2019\/04\/03\/open-source\/pytorch-biggraph\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/engineering.fb.com\/2019\/04\/03\/open-source\/pytorch-biggraph\/#primaryimage","url":"https:\/\/engineering.fb.com\/wp-content\/uploads\/2019\/02\/OSIBgreen.jpg","contentUrl":"https:\/\/engineering.fb.com\/wp-content\/uploads\/2019\/02\/OSIBgreen.jpg","width":1920,"height":1080,"caption":"PyTorch-BigGraph: Faster embeddings of extremely large graphs"},{"@type":"BreadcrumbList","@id":"https:\/\/engineering.fb.com\/2019\/04\/03\/open-source\/pytorch-biggraph\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/engineering.fb.com\/"},{"@type":"ListItem","position":2,"name":"PyTorch-BigGraph: Faster embeddings of extremely large graphs"}]},{"@type":"WebSite","@id":"https:\/\/engineering.fb.com\/#website","url":"https:\/\/engineering.fb.com\/","name":"Engineering at Meta","description":"Engineering at Meta Blog","publisher":{"@id":"https:\/\/engineering.fb.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/engineering.fb.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/engineering.fb.com\/#organization","name":"Meta","url":"https:\/\/engineering.fb.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/engineering.fb.com\/#\/schema\/logo\/image\/","url":"https:\/\/engineering.fb.com\/wp-content\/uploads\/2023\/08\/Meta_lockup_positive-primary_RGB.jpg","contentUrl":"https:\/\/engineering.fb.com\/wp-content\/uploads\/2023\/08\/Meta_lockup_positive-primary_RGB.jpg","width":29011,"height":12501,"caption":"Meta"},"image":{"@id":"https:\/\/engineering.fb.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Engineering\/","https:\/\/x.com\/fb_engineering"]},[]]}},"jetpack_featured_media_url":"https:\/\/engineering.fb.com\/wp-content\/uploads\/2019\/02\/OSIBgreen.jpg","jetpack_shortlink":"https:\/\/wp.me\/pa0Lhq-3k9","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/engineering.fb.com\/wp-json\/wp\/v2\/posts\/12781","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/engineering.fb.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/engineering.fb.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/engineering.fb.com\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/engineering.fb.com\/wp-json\/wp\/v2\/comments?post=12781"}],"version-history":[{"count":4,"href":"https:\/\/engineering.fb.com\/wp-json\/wp\/v2\/posts\/12781\/revisions"}],"predecessor-version":[{"id":12785,"href":"https:\/\/engineering.fb.com\/wp-json\/wp\/v2\/posts\/12781\/revisions\/12785"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/engineering.fb.com\/wp-json\/wp\/v2\/media\/12502"}],"wp:attachment":[{"href":"https:\/\/engineering.fb.com\/wp-json\/wp\/v2\/media?parent=12781"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/engineering.fb.com\/wp-json\/wp\/v2\/categories?post=12781"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/engineering.fb.com\/wp-json\/wp\/v2\/tags?post=12781"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/engineering.fb.com\/wp-json\/wp\/v2\/coauthors?post=12781"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}