From 65ad74af0a269d1877545b0b54c67cce8945acda Mon Sep 17 00:00:00 2001 From: bhavika Date: Fri, 24 May 2024 02:34:00 -0400 Subject: [PATCH 01/28] Add nomic-bert config --- optimum/exporters/onnx/model_configs.py | 2 ++ optimum/exporters/tasks.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/optimum/exporters/onnx/model_configs.py b/optimum/exporters/onnx/model_configs.py index eb0ac9a4988..9436175651b 100644 --- a/optimum/exporters/onnx/model_configs.py +++ b/optimum/exporters/onnx/model_configs.py @@ -113,6 +113,8 @@ def inputs(self) -> Dict[str, Dict[int, str]]: "token_type_ids": dynamic_axis, } +class NomicBertOnnxConfig(BertOnnxConfig): + DEFAULT_ONNX_OPSET = 11 class AlbertOnnxConfig(BertOnnxConfig): DEFAULT_ONNX_OPSET = 11 diff --git a/optimum/exporters/tasks.py b/optimum/exporters/tasks.py index efa782353b4..2f28ef1c587 100644 --- a/optimum/exporters/tasks.py +++ b/optimum/exporters/tasks.py @@ -826,6 +826,8 @@ class TasksManager: "text2text-generation-with-past", onnx="M2M100OnnxConfig", ), + "nomic-bert": supported_tasks_mapping("feature-extraction", + onnx="NomicBertOnnxConfig"), "nystromformer": supported_tasks_mapping( "feature-extraction", "fill-mask", From 34f812175b3c426d3fb34a42d16d81856fead750 Mon Sep 17 00:00:00 2001 From: bhavika Date: Tue, 28 May 2024 22:39:42 -0400 Subject: [PATCH 02/28] Add config --- optimum/exporters/onnx/model_configs.py | 2 ++ optimum/exporters/tasks.py | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/optimum/exporters/onnx/model_configs.py b/optimum/exporters/onnx/model_configs.py index 9436175651b..fa22c0398dc 100644 --- a/optimum/exporters/onnx/model_configs.py +++ b/optimum/exporters/onnx/model_configs.py @@ -113,9 +113,11 @@ def inputs(self) -> Dict[str, Dict[int, str]]: "token_type_ids": dynamic_axis, } + class NomicBertOnnxConfig(BertOnnxConfig): DEFAULT_ONNX_OPSET = 11 + class AlbertOnnxConfig(BertOnnxConfig): DEFAULT_ONNX_OPSET = 11 diff --git a/optimum/exporters/tasks.py b/optimum/exporters/tasks.py index 2f28ef1c587..50545c87190 100644 --- a/optimum/exporters/tasks.py +++ b/optimum/exporters/tasks.py @@ -826,8 +826,7 @@ class TasksManager: "text2text-generation-with-past", onnx="M2M100OnnxConfig", ), - "nomic-bert": supported_tasks_mapping("feature-extraction", - onnx="NomicBertOnnxConfig"), + "nomic-bert": supported_tasks_mapping("feature-extraction", onnx="NomicBertOnnxConfig"), "nystromformer": supported_tasks_mapping( "feature-extraction", "fill-mask", From d55166c6dd485f767b7d098426d000dd8ffa1044 Mon Sep 17 00:00:00 2001 From: bhavika Date: Tue, 28 May 2024 23:08:21 -0400 Subject: [PATCH 03/28] Change opset --- optimum/exporters/onnx/model_configs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/optimum/exporters/onnx/model_configs.py b/optimum/exporters/onnx/model_configs.py index fa22c0398dc..76a17d6f28e 100644 --- a/optimum/exporters/onnx/model_configs.py +++ b/optimum/exporters/onnx/model_configs.py @@ -115,7 +115,7 @@ def inputs(self) -> Dict[str, Dict[int, str]]: class NomicBertOnnxConfig(BertOnnxConfig): - DEFAULT_ONNX_OPSET = 11 + DEFAULT_ONNX_OPSET = 14 class AlbertOnnxConfig(BertOnnxConfig): From eb0f281a2a92638d1b64394cf185bb0e84e629fd Mon Sep 17 00:00:00 2001 From: bhavika Date: Wed, 29 May 2024 02:45:15 -0400 Subject: [PATCH 04/28] Fix typos --- optimum/commands/env.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/optimum/commands/env.py b/optimum/commands/env.py index 9b76a9fb69e..ee01ed06016 100644 --- a/optimum/commands/env.py +++ b/optimum/commands/env.py @@ -57,8 +57,8 @@ def run(self): "Platform": platform.platform(), "Python version": platform.python_version(), "Huggingface_hub version": huggingface_hub.__version__, - "PyTorch version (GPU?)": f"{pt_version} (cuda availabe: {pt_cuda_available})", - "Tensorflow version (GPU?)": f"{tf_version} (cuda availabe: {tf_cuda_available})", + "PyTorch version (GPU?)": f"{pt_version} (cuda available: {pt_cuda_available})", + "Tensorflow version (GPU?)": f"{tf_version} (cuda available: {tf_cuda_available})", } print("\nCopy-and-paste the text below in your GitHub issue:\n") From 2570a3cab7e5088a79e598cc0b5f3385e368ae84 Mon Sep 17 00:00:00 2001 From: bhavika Date: Thu, 6 Jun 2024 08:29:34 -0400 Subject: [PATCH 05/28] Add test --- tests/test_nomicbert.py | 163 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 tests/test_nomicbert.py diff --git a/tests/test_nomicbert.py b/tests/test_nomicbert.py new file mode 100644 index 00000000000..0ae97ef1277 --- /dev/null +++ b/tests/test_nomicbert.py @@ -0,0 +1,163 @@ +import numpy as np +from transformers import AutoTokenizer, AutoModel +from pathlib import Path +from optimum.exporters import TasksManager +from optimum.exporters.onnx import export +import onnx +from optimum.exporters.onnx import validate_model_outputs +from optimum.onnxruntime import ORTModelForFeatureExtraction +import torch + +long_input = """ +In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games. + +As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time. + +As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi" and later on "The Sims," expanding the scope of interactive entertainment beyond traditional genres. + +As technology continued to evolve, the late 1990s and early 2000s introduced another paradigm shift with the advent of 3D graphics. The fifth-generation consoles, such as the Sony PlayStation and the Nintendo 64, exploited this new capability to full effect, giving players the ability to navigate three-dimensional spaces and experience games in a novel, more immersive way. Titles such as "Super Mario 64" and "The Legend of Zelda: Ocarina of Time" became epitomes of how three-dimensional gameplay could revolutionize game design. These games offered expansive, open worlds to explore, seamlessly blending engaging mechanics with storytelling elements that gave players a sense of agency and exploration previously unattainable. The rise of 3D also heralded the beginning of cinematic storytelling in games, with titles like "Metal Gear Solid" incorporating voice acting, elaborate plots, and complex character development to create an experience akin to interactive films. + +The advent of the internet exponentially increased the reach and interactivity of video games, leading to the proliferation of massive multiplayer online games (MMOs) in the early 2000s. Titles like "World of Warcraft" created virtual worlds where millions of players could interact, cooperate, and compete in real-time. This evolution not only changed the way games were played but also formed communities that blurred the line between virtual and real worlds, creating social networks within the gaming ecosystem. The ability to play with and against others from across the globe added a new layer of engagement and longevity to the gaming experience. + +With the introduction of high-definition graphics in the mid-2000s, home consoles like the Xbox 360 and PlayStation 3 brought previously unseen levels of detail and realism to video games. This era saw the rise of popular franchises such as "Call of Duty" and "Assassin's Creed," which delivered cinematic experiences that rivaled blockbuster films. These games raised the bar for production values in terms of graphics, sound, and storytelling, creating immersive worlds that players could lose themselves in for hours on end. The emergence of digital distribution platforms like Steam also began to change the landscape of game publishing and distribution, allowing indie developers to bring innovative and unique games to the market without the backing of major publishers. This democratization of game development resulted in a broader diversity of gaming experiences, from small art-house projects to sprawling open-world epics. + +The advent of mobile gaming in the late 2000s introduced yet another seismic shift in how and where games were played. The ubiquity of smartphones brought gaming to a global audience that was previously untapped, making it an everyday activity accessible to anyone, anywhere. Casual games like "Angry Birds" and "Candy Crush Saga" became cultural phenomena, engaging a wider demographic and changing the public perception of what a video game could be. The success of mobile gaming has also led to the development of hybrid experiences, with many traditional video game franchises finding new life and audiences on mobile platforms. This era has also seen the rise of in-app purchases and microtransactions as a business model, influencing the design and monetization strategies of games across all platforms. + +Virtual reality (VR) and augmented reality (AR) technologies, though still in their relative infancy, represent the next frontier in video gaming. Devices like the Oculus Rift, HTC Vive, and PlayStation VR have begun to offer players completely immersive experiences, placing them directly within the game world. VR technology has the potential to transform not only gaming but also a host of other industries, from education to healthcare. AR games like "Pokémon GO" have demonstrated how blending the virtual with the real world can create unique and engaging experiences, bringing players together in communal activities focused on exploration and shared adventures. + +Esports has emerged as a significant cultural and economic force, with professional players and teams competing in tournaments with prize pools reaching millions of dollars. Games like "League of Legends," "Dota 2," and "Fortnite" have become global spectacles, attracting audiences that rival those of traditional sports. The rise of streaming platforms like Twitch has further facilitated the growth of esports, allowing players to build careers around broadcasting their gameplay to fans around the world. The convergence of gaming and social media has also enabled content creators and influencers to shape and drive gaming culture, blurring the lines between playing games and participating in a wider community. + +Cloud gaming represents another transformative trend, promising to revolutionize how games are accessed and played. Services like Google Stadia, Microsoft’s xCloud, and NVIDIA’s GeForce Now aim to make high-quality gaming accessible on a variety of devices without the need for powerful local hardware. By streaming games from remote servers, cloud gaming could democratize access to cutting-edge experiences, enabling players to enjoy high-end titles on smartphones, tablets, and other internet-connected devices. This technology has the potential to reshape the industry’s economic models, reduce the barriers to entry, and allow for more seamless and instant access to a vast library of games. + +Despite its many successes, the video game industry has not been without controversy. Issues such as crunch culture, diversity and representation, loot boxes, and the impact of violent content have all sparked significant dialogue and debate amongst players, developers, and policymakers. The industry continues to grapple with these challenges as it seeks to balance innovation and growth with ethical considerations and social responsibility. Nevertheless, video games have established themselves as a powerful medium with the capacity to entertain, educate, and inspire in ways that are unique to the interactive nature of the medium. They offer immersive experiences that can transport players to fantastical worlds, tell complex stories, and provide social connections that transcend geographical boundaries. + +The evolution of video games is a testament to the creativity, ingenuity, and passion of both developers and players. From the early, pixelated days of "Pong" to the richly detailed, expansive virtual worlds of today, video games have continuously pushed the boundaries of technology and art. As the medium evolves, it will undoubtedly continue to break new ground, offering novel experiences and forging deeper connections between players. The future of video games is limited only by the imagination of those who create and play them, and it promises to be as dynamic and innovative as the history that has brought us to this point. + +In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games. + +As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time. + +As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi" and later on "The Sims," expanding the scope of interactive entertainment beyond traditional genres. + +As technology continued to evolve, the late 1990s and early 2000s introduced another paradigm shift with the advent of 3D graphics. The fifth-generation consoles, such as the Sony PlayStation and the Nintendo 64, exploited this new capability to full effect, giving players the ability to navigate three-dimensional spaces and experience games in a novel, more immersive way. Titles such as "Super Mario 64" and "The Legend of Zelda: Ocarina of Time" became epitomes of how three-dimensional gameplay could revolutionize game design. These games offered expansive, open worlds to explore, seamlessly blending engaging mechanics with storytelling elements that gave players a sense of agency and exploration previously unattainable. The rise of 3D also heralded the beginning of cinematic storytelling in games, with titles like "Metal Gear Solid" incorporating voice acting, elaborate plots, and complex character development to create an experience akin to interactive films. + +The advent of the internet exponentially increased the reach and interactivity of video games, leading to the proliferation of massive multiplayer online games (MMOs) in the early 2000s. Titles like "World of Warcraft" created virtual worlds where millions of players could interact, cooperate, and compete in real-time. This evolution not only changed the way games were played but also formed communities that blurred the line between virtual and real worlds, creating social networks within the gaming ecosystem. The ability to play with and against others from across the globe added a new layer of engagement and longevity to the gaming experience. + +With the introduction of high-definition graphics in the mid-2000s, home consoles like the Xbox 360 and PlayStation 3 brought previously unseen levels of detail and realism to video games. This era saw the rise of popular franchises such as "Call of Duty" and "Assassin's Creed," which delivered cinematic experiences that rivaled blockbuster films. These games raised the bar for production values in terms of graphics, sound, and storytelling, creating immersive worlds that players could lose themselves in for hours on end. The emergence of digital distribution platforms like Steam also began to change the landscape of game publishing and distribution, allowing indie developers to bring innovative and unique games to the market without the backing of major publishers. This democratization of game development resulted in a broader diversity of gaming experiences, from small art-house projects to sprawling open-world epics. + +The advent of mobile gaming in the late 2000s introduced yet another seismic shift in how and where games were played. The ubiquity of smartphones brought gaming to a global audience that was previously untapped, making it an everyday activity accessible to anyone, anywhere. Casual games like "Angry Birds" and "Candy Crush Saga" became cultural phenomena, engaging a wider demographic and changing the public perception of what a video game could be. The success of mobile gaming has also led to the development of hybrid experiences, with many traditional video game franchises finding new life and audiences on mobile platforms. This era has also seen the rise of in-app purchases and microtransactions as a business model, influencing the design and monetization strategies of games across all platforms. + +Virtual reality (VR) and augmented reality (AR) technologies, though still in their relative infancy, represent the next frontier in video gaming. Devices like the Oculus Rift, HTC Vive, and PlayStation VR have begun to offer players completely immersive experiences, placing them directly within the game world. VR technology has the potential to transform not only gaming but also a host of other industries, from education to healthcare. AR games like "Pokémon GO" have demonstrated how blending the virtual with the real world can create unique and engaging experiences, bringing players together in communal activities focused on exploration and shared adventures. + +Esports has emerged as a significant cultural and economic force, with professional players and teams competing in tournaments with prize pools reaching millions of dollars. Games like "League of Legends," "Dota 2," and "Fortnite" have become global spectacles, attracting audiences that rival those of traditional sports. The rise of streaming platforms like Twitch has further facilitated the growth of esports, allowing players to build careers around broadcasting their gameplay to fans around the world. The convergence of gaming and social media has also enabled content creators and influencers to shape and drive gaming culture, blurring the lines between playing games and participating in a wider community. + +Cloud gaming represents another transformative trend, promising to revolutionize how games are accessed and played. Services like Google Stadia, Microsoft’s xCloud, and NVIDIA’s GeForce Now aim to make high-quality gaming accessible on a variety of devices without the need for powerful local hardware. By streaming games from remote servers, cloud gaming could democratize access to cutting-edge experiences, enabling players to enjoy high-end titles on smartphones, tablets, and other internet-connected devices. This technology has the potential to reshape the industry’s economic models, reduce the barriers to entry, and allow for more seamless and instant access to a vast library of games. + +Despite its many successes, the video game industry has not been without controversy. Issues such as crunch culture, diversity and representation, loot boxes, and the impact of violent content have all sparked significant dialogue and debate amongst players, developers, and policymakers. The industry continues to grapple with these challenges as it seeks to balance innovation and growth with ethical considerations and social responsibility. Nevertheless, video games have established themselves as a powerful medium with the capacity to entertain, educate, and inspire in ways that are unique to the interactive nature of the medium. They offer immersive experiences that can transport players to fantastical worlds, tell complex stories, and provide social connections that transcend geographical boundaries. + +The evolution of video games is a testament to the creativity, ingenuity, and passion of both developers and players. From the early, pixelated days of "Pong" to the richly detailed, expansive virtual worlds of today, video games have continuously pushed the boundaries of technology and art. As the medium evolves, it will undoubtedly continue to break new ground, offering novel experiences and forging deeper connections between players. The future of video games is limited only by the imagination of those who create and play them, and it promises to be as dynamic and innovative as the history that has brought us to this point. + +In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games. + +As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time. + +As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi" and later on "The Sims," expanding the scope of interactive entertainment beyond traditional genres. + +As technology continued to evolve, the late 1990s and early 2000s introduced another paradigm shift with the advent of 3D graphics. The fifth-generation consoles, such as the Sony PlayStation and the Nintendo 64, exploited this new capability to full effect, giving players the ability to navigate three-dimensional spaces and experience games in a novel, more immersive way. Titles such as "Super Mario 64" and "The Legend of Zelda: Ocarina of Time" became epitomes of how three-dimensional gameplay could revolutionize game design. These games offered expansive, open worlds to explore, seamlessly blending engaging mechanics with storytelling elements that gave players a sense of agency and exploration previously unattainable. The rise of 3D also heralded the beginning of cinematic storytelling in games, with titles like "Metal Gear Solid" incorporating voice acting, elaborate plots, and complex character development to create an experience akin to interactive films. + +The advent of the internet exponentially increased the reach and interactivity of video games, leading to the proliferation of massive multiplayer online games (MMOs) in the early 2000s. Titles like "World of Warcraft" created virtual worlds where millions of players could interact, cooperate, and compete in real-time. This evolution not only changed the way games were played but also formed communities that blurred the line between virtual and real worlds, creating social networks within the gaming ecosystem. The ability to play with and against others from across the globe added a new layer of engagement and longevity to the gaming experience. + +With the introduction of high-definition graphics in the mid-2000s, home consoles like the Xbox 360 and PlayStation 3 brought previously unseen levels of detail and realism to video games. This era saw the rise of popular franchises such as "Call of Duty" and "Assassin's Creed," which delivered cinematic experiences that rivaled blockbuster films. These games raised the bar for production values in terms of graphics, sound, and storytelling, creating immersive worlds that players could lose themselves in for hours on end. The emergence of digital distribution platforms like Steam also began to change the landscape of game publishing and distribution, allowing indie developers to bring innovative and unique games to the market without the backing of major publishers. This democratization of game development resulted in a broader diversity of gaming experiences, from small art-house projects to sprawling open-world epics. + +The advent of mobile gaming in the late 2000s introduced yet another seismic shift in how and where games were played. The ubiquity of smartphones brought gaming to a global audience that was previously untapped, making it an everyday activity accessible to anyone, anywhere. Casual games like "Angry Birds" and "Candy Crush Saga" became cultural phenomena, engaging a wider demographic and changing the public perception of what a video game could be. The success of mobile gaming has also led to the development of hybrid experiences, with many traditional video game franchises finding new life and audiences on mobile platforms. This era has also seen the rise of in-app purchases and microtransactions as a business model, influencing the design and monetization strategies of games across all platforms. + +Virtual reality (VR) and augmented reality (AR) technologies, though still in their relative infancy, represent the next frontier in video gaming. Devices like the Oculus Rift, HTC Vive, and PlayStation VR have begun to offer players completely immersive experiences, placing them directly within the game world. VR technology has the potential to transform not only gaming but also a host of other industries, from education to healthcare. AR games like "Pokémon GO" have demonstrated how blending the virtual with the real world can create unique and engaging experiences, bringing players together in communal activities focused on exploration and shared adventures. + +Esports has emerged as a significant cultural and economic force, with professional players and teams competing in tournaments with prize pools reaching millions of dollars. Games like "League of Legends," "Dota 2," and "Fortnite" have become global spectacles, attracting audiences that rival those of traditional sports. The rise of streaming platforms like Twitch has further facilitated the growth of esports, allowing players to build careers around broadcasting their gameplay to fans around the world. The convergence of gaming and social media has also enabled content creators and influencers to shape and drive gaming culture, blurring the lines between playing games and participating in a wider community. + +Cloud gaming represents another transformative trend, promising to revolutionize how games are accessed and played. Services like Google Stadia, Microsoft’s xCloud, and NVIDIA’s GeForce Now aim to make high-quality gaming accessible on a variety of devices without the need for powerful local hardware. By streaming games from remote servers, cloud gaming could democratize access to cutting-edge experiences, enabling players to enjoy high-end titles on smartphones, tablets, and other internet-connected devices. This technology has the potential to reshape the industry’s economic models, reduce the barriers to entry, and allow for more seamless and instant access to a vast library of games. + +Despite its many successes, the video game industry has not been without controversy. Issues such as crunch culture, diversity and representation, loot boxes, and the impact of violent content have all sparked significant dialogue and debate amongst players, developers, and policymakers. The industry continues to grapple with these challenges as it seeks to balance innovation and growth with ethical considerations and social responsibility. Nevertheless, video games have established themselves as a powerful medium with the capacity to entertain, educate, and inspire in ways that are unique to the interactive nature of the medium. They offer immersive experiences that can transport players to fantastical worlds, tell complex stories, and provide social connections that transcend geographical boundaries. + +The evolution of video games is a testament to the creativity, ingenuity, and passion of both developers and players. From the early, pixelated days of "Pong" to the richly detailed, expansive virtual worlds of today, video games have continuously pushed the boundaries of technology and art. As the medium evolves, it will undoubtedly continue to break new ground, offering novel experiences and forging deeper connections between players. The future of video games is limited only by the imagination of those who create and play them, and it promises to be as dynamic and innovative as the history that has brought us to this point. + +In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games. + +As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time. + +As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi" and later on "The Sims," expanding the scope of interactive entertainment beyond traditional genres. + +As technology continued to evolve, the late 1990s and early 2000s introduced another paradigm shift with the advent of 3D graphics. The fifth-generation consoles, such as the Sony PlayStation and the Nintendo 64, exploited this new capability to full effect, giving players the ability to navigate three-dimensional spaces and experience games in a novel, more immersive way. Titles such as "Super Mario 64" and "The Legend of Zelda: Ocarina of Time" became epitomes of how three-dimensional gameplay could revolutionize game design. These games offered expansive, open worlds to explore, seamlessly blending engaging mechanics with storytelling elements that gave players a sense of agency and exploration previously unattainable. The rise of 3D also heralded the beginning of cinematic storytelling in games, with titles like "Metal Gear Solid" incorporating voice acting, elaborate plots, and complex character development to create an experience akin to interactive films. + +The advent of the internet exponentially increased the reach and interactivity of video games, leading to the proliferation of massive multiplayer online games (MMOs) in the early 2000s. Titles like "World of Warcraft" created virtual worlds where millions of players could interact, cooperate, and compete in real-time. This evolution not only changed the way games were played but also formed communities that blurred the line between virtual and real worlds, creating social networks within the gaming ecosystem. The ability to play with and against others from across the globe added a new layer of engagement and longevity to the gaming experience. + +With the introduction of high-definition graphics in the mid-2000s, home consoles like the Xbox 360 and PlayStation 3 brought previously unseen levels of detail and realism to video games. This era saw the rise of popular franchises such as "Call of Duty" and "Assassin's Creed," which delivered cinematic experiences that rivaled blockbuster films. These games raised the bar for production values in terms of graphics, sound, and storytelling, creating immersive worlds that players could lose themselves in for hours on end. The emergence of digital distribution platforms like Steam also began to change the landscape of game publishing and distribution, allowing indie developers to bring innovative and unique games to the market without the backing of major publishers. This democratization of game development resulted in a broader diversity of gaming experiences, from small art-house projects to sprawling open-world epics. + +The advent of mobile gaming in the late 2000s introduced yet another seismic shift in how and where games were played. The ubiquity of smartphones brought gaming to a global audience that was previously untapped, making it an everyday activity accessible to anyone, anywhere. Casual games like "Angry Birds" and "Candy Crush Saga" became cultural phenomena, engaging a wider demographic and changing the public perception of what a video game could be. The success of mobile gaming has also led to the development of hybrid experiences, with many traditional video game franchises finding new life and audiences on mobile platforms. This era has also seen the rise of in-app purchases and microtransactions as a business model, influencing the design and monetization strategies of games across all platforms. + +Virtual reality (VR) and augmented reality (AR) technologies, though still in their relative infancy, represent the next frontier in video gaming. Devices like the Oculus Rift, HTC Vive, and PlayStation VR have begun to offer players completely immersive experiences, placing them directly within the game world. VR technology has the potential to transform not only gaming but also a host of other industries, from education to healthcare. AR games like "Pokémon GO" have demonstrated how blending the virtual with the real world can create unique and engaging experiences, bringing players together in communal activities focused on exploration and shared adventures. + +Esports has emerged as a significant cultural and economic force, with professional players and teams competing in tournaments with prize pools reaching millions of dollars. Games like "League of Legends," "Dota 2," and "Fortnite" have become global spectacles, attracting audiences that rival those of traditional sports. The rise of streaming platforms like Twitch has further facilitated the growth of esports, allowing players to build careers around broadcasting their gameplay to fans around the world. The convergence of gaming and social media has also enabled content creators and influencers to shape and drive gaming culture, blurring the lines between playing games and participating in a wider community. + +Cloud gaming represents another transformative trend, promising to revolutionize how games are accessed and played. Services like Google Stadia, Microsoft’s xCloud, and NVIDIA’s GeForce Now aim to make high-quality gaming accessible on a variety of devices without the need for powerful local hardware. By streaming games from remote servers, cloud gaming could democratize access to cutting-edge experiences, enabling players to enjoy high-end titles on smartphones, tablets, and other internet-connected devices. This technology has the potential to reshape the industry’s economic models, reduce the barriers to entry, and allow for more seamless and instant access to a vast library of games. + +Despite its many successes, the video game industry has not been without controversy. Issues such as crunch culture, diversity and representation, loot boxes, and the impact of violent content have all sparked significant dialogue and debate amongst players, developers, and policymakers. The industry continues to grapple with these challenges as it seeks to balance innovation and growth with ethical considerations and social responsibility. Nevertheless, video games have established themselves as a powerful medium with the capacity to entertain, educate, and inspire in ways that are unique to the interactive nature of the medium. They offer immersive experiences that can transport players to fantastical worlds, tell complex stories, and provide social connections that transcend geographical boundaries. + +The evolution of video games is a testament to the creativity, ingenuity, and passion of both developers and players. From the early, pixelated days of "Pong" to the richly detailed, expansive virtual worlds of today, video games have continuously pushed the boundaries of technology and art. As the medium evolves, it will undoubtedly continue to break new ground, offering novel experiences and forging deeper connections between players. The future of video games is limited only by the imagination of those who create and play them, and it promises to be as dynamic and innovative as the history that has brought us to this point. + +In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games. + +As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time. + +As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi". +""" + + +if __name__ == "__main__": + MODEL_NAME = "nomic-ai/nomic-embed-text-v1.5" + tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased") + long_inputs = tokenizer(long_input, return_tensors="pt", padding=True) + num_tokens = long_inputs['input_ids'].shape + + print(f"Number of tokens in the input: {num_tokens}") + + hf_model = AutoModel.from_pretrained( + MODEL_NAME, + trust_remote_code=True, + safe_serialization=True, + revision="91d2d6bfdddf0b0da840f901b533e99bae30d757", + force_download=True + ) + + onnx_path = Path("tests/nomic_bert.onnx") + onnx_config_constructor = TasksManager.get_exporter_config_constructor( + "onnx", hf_model, task="feature-extraction", library_name="transformers" + ) + onnx_config = onnx_config_constructor(hf_model.config) + onnx_inputs, onnx_outputs = export(hf_model, onnx_config, onnx_path, onnx_config.DEFAULT_ONNX_OPSET) + + print("After export") + print(onnx_inputs) + print(onnx_outputs) + + onnx_model = onnx.load(onnx_path) + onnx.checker.check_model(onnx_model) + + validate_model_outputs(onnx_config, hf_model, onnx_path, onnx_outputs, onnx_config.ATOL_FOR_VALIDATION) + + model = ORTModelForFeatureExtraction.from_pretrained( + MODEL_NAME, + file_name="onnx/model.onnx", + trust_remote_code=True, + safe_serialization=True + ) + + long_inputs_gpu = {k: v.to('cuda') for k, v in long_inputs.items()} + hf_model.to('cuda') + model.to('cuda') + + print("Testing for longer sequence length for Nomic-AI model") + optimum_model_outputs = model(**long_inputs_gpu) + hf_model_outputs = hf_model(**long_inputs_gpu) + print("Are outputs from both models close when using longer texts?", np.allclose(optimum_model_outputs.last_hidden_state.cpu().detach().numpy(), hf_model_outputs.last_hidden_state.cpu().detach().numpy(), rtol=1e-3, atol=1e-3)) + From 150739f335d061b206b6142814415785c09a741c Mon Sep 17 00:00:00 2001 From: bhavika Date: Sat, 8 Jun 2024 12:15:45 -0400 Subject: [PATCH 06/28] Add to config --- optimum/utils/normalized_config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/optimum/utils/normalized_config.py b/optimum/utils/normalized_config.py index 682f70e3ca3..795f3d57597 100644 --- a/optimum/utils/normalized_config.py +++ b/optimum/utils/normalized_config.py @@ -247,6 +247,7 @@ class NormalizedConfigManager: "mpt": MPTNormalizedTextConfig, "mt5": T5LikeNormalizedTextConfig, "m2m-100": BartLikeNormalizedTextConfig, + "nomic-bert": NormalizedTextConfig, "nystromformer": NormalizedTextConfig, "opt": NormalizedTextConfig, "pegasus": BartLikeNormalizedTextConfig, From 985703b4450029ed4e4f3b669b7580243d76025d Mon Sep 17 00:00:00 2001 From: bhavika Date: Tue, 25 Jun 2024 12:01:39 -0400 Subject: [PATCH 07/28] Add nomic-bert to supported architectures --- tests/onnxruntime/test_modeling.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/onnxruntime/test_modeling.py b/tests/onnxruntime/test_modeling.py index 3fe2c5e14dc..39cd4fb4cb4 100644 --- a/tests/onnxruntime/test_modeling.py +++ b/tests/onnxruntime/test_modeling.py @@ -1989,6 +1989,7 @@ class ORTModelForFeatureExtractionIntegrationTest(ORTModelTestMixin): "mpnet", "roberta", "xlm_roberta", + "nomic-bert" ] FULL_GRID = {"model_arch": SUPPORTED_ARCHITECTURES} From 82a788f0e203a65d8ad5cef359b7908666c735ec Mon Sep 17 00:00:00 2001 From: bhavika Date: Wed, 26 Jun 2024 10:29:35 -0400 Subject: [PATCH 08/28] Add test for exporter --- .../exporters/onnx/test_exporters_onnx_cli.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/exporters/onnx/test_exporters_onnx_cli.py b/tests/exporters/onnx/test_exporters_onnx_cli.py index 667206b0068..953288dc016 100644 --- a/tests/exporters/onnx/test_exporters_onnx_cli.py +++ b/tests/exporters/onnx/test_exporters_onnx_cli.py @@ -594,6 +594,14 @@ def test_trust_remote_code(self): check=True, ) + with TemporaryDirectory() as tmpdirname: + out = subprocess.run( + f"python3 -m optimum.exporters.onnx --trust-remote-code --model nomic-ai/nomic-embed-text-v1.5 --task feature-extraction {tmpdirname}", + shell=True, + check=True, + ) + self.assertFalse(out.returncode) + def test_stable_diffusion(self): with TemporaryDirectory() as tmpdirname: subprocess.run( @@ -730,3 +738,20 @@ def test_complex_synonyms(self): model.save_pretrained(tmpdir_in) main_export(model_name_or_path=tmpdir_in, output=tmpdir_out, task="text-classification") + + @slow + def test_custom_model(self): + with TemporaryDirectory() as tmpdirname: + out = subprocess.run( + f" python3 -m optimum.exporters.onnx --trust-remote-code --model nomic-ai/nomic-embed-text-v1.5 --task feature-extraction {tmpdirname}", + shell=True, + capture_output=True, + ) + self.assertFalse(out.returncode) + + with TemporaryDirectory() as tmpdirname: + out = subprocess.run( + f"python3 -m optimum.exporters.onnx --trust-remote-code --model fxmarty/tiny-testing-gpt2-remote-code --task text-generation {tmpdirname}", + shell=True, + check=True, + ) \ No newline at end of file From 1cadbd3866111472dc2dcdad2cedf9baa357fcb2 Mon Sep 17 00:00:00 2001 From: bhavika Date: Wed, 26 Jun 2024 10:40:03 -0400 Subject: [PATCH 09/28] remove test file --- .../exporters/onnx/test_exporters_onnx_cli.py | 10 +- tests/onnxruntime/test_modeling.py | 3 +- tests/test_nomicbert.py | 163 ------------------ 3 files changed, 2 insertions(+), 174 deletions(-) delete mode 100644 tests/test_nomicbert.py diff --git a/tests/exporters/onnx/test_exporters_onnx_cli.py b/tests/exporters/onnx/test_exporters_onnx_cli.py index 953288dc016..8d821e8cfe6 100644 --- a/tests/exporters/onnx/test_exporters_onnx_cli.py +++ b/tests/exporters/onnx/test_exporters_onnx_cli.py @@ -594,14 +594,6 @@ def test_trust_remote_code(self): check=True, ) - with TemporaryDirectory() as tmpdirname: - out = subprocess.run( - f"python3 -m optimum.exporters.onnx --trust-remote-code --model nomic-ai/nomic-embed-text-v1.5 --task feature-extraction {tmpdirname}", - shell=True, - check=True, - ) - self.assertFalse(out.returncode) - def test_stable_diffusion(self): with TemporaryDirectory() as tmpdirname: subprocess.run( @@ -751,7 +743,7 @@ def test_custom_model(self): with TemporaryDirectory() as tmpdirname: out = subprocess.run( - f"python3 -m optimum.exporters.onnx --trust-remote-code --model fxmarty/tiny-testing-gpt2-remote-code --task text-generation {tmpdirname}", + f"python3 -m optimum.exporters.onnx --trust-remote-code --model nomic-ai/nomic-embed-text-v1.5 --task feature-extraction {tmpdirname}", shell=True, check=True, ) \ No newline at end of file diff --git a/tests/onnxruntime/test_modeling.py b/tests/onnxruntime/test_modeling.py index 39cd4fb4cb4..b52a724f0e3 100644 --- a/tests/onnxruntime/test_modeling.py +++ b/tests/onnxruntime/test_modeling.py @@ -1988,8 +1988,7 @@ class ORTModelForFeatureExtractionIntegrationTest(ORTModelTestMixin): "electra", "mpnet", "roberta", - "xlm_roberta", - "nomic-bert" + "xlm_roberta" ] FULL_GRID = {"model_arch": SUPPORTED_ARCHITECTURES} diff --git a/tests/test_nomicbert.py b/tests/test_nomicbert.py deleted file mode 100644 index 0ae97ef1277..00000000000 --- a/tests/test_nomicbert.py +++ /dev/null @@ -1,163 +0,0 @@ -import numpy as np -from transformers import AutoTokenizer, AutoModel -from pathlib import Path -from optimum.exporters import TasksManager -from optimum.exporters.onnx import export -import onnx -from optimum.exporters.onnx import validate_model_outputs -from optimum.onnxruntime import ORTModelForFeatureExtraction -import torch - -long_input = """ -In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games. - -As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time. - -As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi" and later on "The Sims," expanding the scope of interactive entertainment beyond traditional genres. - -As technology continued to evolve, the late 1990s and early 2000s introduced another paradigm shift with the advent of 3D graphics. The fifth-generation consoles, such as the Sony PlayStation and the Nintendo 64, exploited this new capability to full effect, giving players the ability to navigate three-dimensional spaces and experience games in a novel, more immersive way. Titles such as "Super Mario 64" and "The Legend of Zelda: Ocarina of Time" became epitomes of how three-dimensional gameplay could revolutionize game design. These games offered expansive, open worlds to explore, seamlessly blending engaging mechanics with storytelling elements that gave players a sense of agency and exploration previously unattainable. The rise of 3D also heralded the beginning of cinematic storytelling in games, with titles like "Metal Gear Solid" incorporating voice acting, elaborate plots, and complex character development to create an experience akin to interactive films. - -The advent of the internet exponentially increased the reach and interactivity of video games, leading to the proliferation of massive multiplayer online games (MMOs) in the early 2000s. Titles like "World of Warcraft" created virtual worlds where millions of players could interact, cooperate, and compete in real-time. This evolution not only changed the way games were played but also formed communities that blurred the line between virtual and real worlds, creating social networks within the gaming ecosystem. The ability to play with and against others from across the globe added a new layer of engagement and longevity to the gaming experience. - -With the introduction of high-definition graphics in the mid-2000s, home consoles like the Xbox 360 and PlayStation 3 brought previously unseen levels of detail and realism to video games. This era saw the rise of popular franchises such as "Call of Duty" and "Assassin's Creed," which delivered cinematic experiences that rivaled blockbuster films. These games raised the bar for production values in terms of graphics, sound, and storytelling, creating immersive worlds that players could lose themselves in for hours on end. The emergence of digital distribution platforms like Steam also began to change the landscape of game publishing and distribution, allowing indie developers to bring innovative and unique games to the market without the backing of major publishers. This democratization of game development resulted in a broader diversity of gaming experiences, from small art-house projects to sprawling open-world epics. - -The advent of mobile gaming in the late 2000s introduced yet another seismic shift in how and where games were played. The ubiquity of smartphones brought gaming to a global audience that was previously untapped, making it an everyday activity accessible to anyone, anywhere. Casual games like "Angry Birds" and "Candy Crush Saga" became cultural phenomena, engaging a wider demographic and changing the public perception of what a video game could be. The success of mobile gaming has also led to the development of hybrid experiences, with many traditional video game franchises finding new life and audiences on mobile platforms. This era has also seen the rise of in-app purchases and microtransactions as a business model, influencing the design and monetization strategies of games across all platforms. - -Virtual reality (VR) and augmented reality (AR) technologies, though still in their relative infancy, represent the next frontier in video gaming. Devices like the Oculus Rift, HTC Vive, and PlayStation VR have begun to offer players completely immersive experiences, placing them directly within the game world. VR technology has the potential to transform not only gaming but also a host of other industries, from education to healthcare. AR games like "Pokémon GO" have demonstrated how blending the virtual with the real world can create unique and engaging experiences, bringing players together in communal activities focused on exploration and shared adventures. - -Esports has emerged as a significant cultural and economic force, with professional players and teams competing in tournaments with prize pools reaching millions of dollars. Games like "League of Legends," "Dota 2," and "Fortnite" have become global spectacles, attracting audiences that rival those of traditional sports. The rise of streaming platforms like Twitch has further facilitated the growth of esports, allowing players to build careers around broadcasting their gameplay to fans around the world. The convergence of gaming and social media has also enabled content creators and influencers to shape and drive gaming culture, blurring the lines between playing games and participating in a wider community. - -Cloud gaming represents another transformative trend, promising to revolutionize how games are accessed and played. Services like Google Stadia, Microsoft’s xCloud, and NVIDIA’s GeForce Now aim to make high-quality gaming accessible on a variety of devices without the need for powerful local hardware. By streaming games from remote servers, cloud gaming could democratize access to cutting-edge experiences, enabling players to enjoy high-end titles on smartphones, tablets, and other internet-connected devices. This technology has the potential to reshape the industry’s economic models, reduce the barriers to entry, and allow for more seamless and instant access to a vast library of games. - -Despite its many successes, the video game industry has not been without controversy. Issues such as crunch culture, diversity and representation, loot boxes, and the impact of violent content have all sparked significant dialogue and debate amongst players, developers, and policymakers. The industry continues to grapple with these challenges as it seeks to balance innovation and growth with ethical considerations and social responsibility. Nevertheless, video games have established themselves as a powerful medium with the capacity to entertain, educate, and inspire in ways that are unique to the interactive nature of the medium. They offer immersive experiences that can transport players to fantastical worlds, tell complex stories, and provide social connections that transcend geographical boundaries. - -The evolution of video games is a testament to the creativity, ingenuity, and passion of both developers and players. From the early, pixelated days of "Pong" to the richly detailed, expansive virtual worlds of today, video games have continuously pushed the boundaries of technology and art. As the medium evolves, it will undoubtedly continue to break new ground, offering novel experiences and forging deeper connections between players. The future of video games is limited only by the imagination of those who create and play them, and it promises to be as dynamic and innovative as the history that has brought us to this point. - -In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games. - -As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time. - -As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi" and later on "The Sims," expanding the scope of interactive entertainment beyond traditional genres. - -As technology continued to evolve, the late 1990s and early 2000s introduced another paradigm shift with the advent of 3D graphics. The fifth-generation consoles, such as the Sony PlayStation and the Nintendo 64, exploited this new capability to full effect, giving players the ability to navigate three-dimensional spaces and experience games in a novel, more immersive way. Titles such as "Super Mario 64" and "The Legend of Zelda: Ocarina of Time" became epitomes of how three-dimensional gameplay could revolutionize game design. These games offered expansive, open worlds to explore, seamlessly blending engaging mechanics with storytelling elements that gave players a sense of agency and exploration previously unattainable. The rise of 3D also heralded the beginning of cinematic storytelling in games, with titles like "Metal Gear Solid" incorporating voice acting, elaborate plots, and complex character development to create an experience akin to interactive films. - -The advent of the internet exponentially increased the reach and interactivity of video games, leading to the proliferation of massive multiplayer online games (MMOs) in the early 2000s. Titles like "World of Warcraft" created virtual worlds where millions of players could interact, cooperate, and compete in real-time. This evolution not only changed the way games were played but also formed communities that blurred the line between virtual and real worlds, creating social networks within the gaming ecosystem. The ability to play with and against others from across the globe added a new layer of engagement and longevity to the gaming experience. - -With the introduction of high-definition graphics in the mid-2000s, home consoles like the Xbox 360 and PlayStation 3 brought previously unseen levels of detail and realism to video games. This era saw the rise of popular franchises such as "Call of Duty" and "Assassin's Creed," which delivered cinematic experiences that rivaled blockbuster films. These games raised the bar for production values in terms of graphics, sound, and storytelling, creating immersive worlds that players could lose themselves in for hours on end. The emergence of digital distribution platforms like Steam also began to change the landscape of game publishing and distribution, allowing indie developers to bring innovative and unique games to the market without the backing of major publishers. This democratization of game development resulted in a broader diversity of gaming experiences, from small art-house projects to sprawling open-world epics. - -The advent of mobile gaming in the late 2000s introduced yet another seismic shift in how and where games were played. The ubiquity of smartphones brought gaming to a global audience that was previously untapped, making it an everyday activity accessible to anyone, anywhere. Casual games like "Angry Birds" and "Candy Crush Saga" became cultural phenomena, engaging a wider demographic and changing the public perception of what a video game could be. The success of mobile gaming has also led to the development of hybrid experiences, with many traditional video game franchises finding new life and audiences on mobile platforms. This era has also seen the rise of in-app purchases and microtransactions as a business model, influencing the design and monetization strategies of games across all platforms. - -Virtual reality (VR) and augmented reality (AR) technologies, though still in their relative infancy, represent the next frontier in video gaming. Devices like the Oculus Rift, HTC Vive, and PlayStation VR have begun to offer players completely immersive experiences, placing them directly within the game world. VR technology has the potential to transform not only gaming but also a host of other industries, from education to healthcare. AR games like "Pokémon GO" have demonstrated how blending the virtual with the real world can create unique and engaging experiences, bringing players together in communal activities focused on exploration and shared adventures. - -Esports has emerged as a significant cultural and economic force, with professional players and teams competing in tournaments with prize pools reaching millions of dollars. Games like "League of Legends," "Dota 2," and "Fortnite" have become global spectacles, attracting audiences that rival those of traditional sports. The rise of streaming platforms like Twitch has further facilitated the growth of esports, allowing players to build careers around broadcasting their gameplay to fans around the world. The convergence of gaming and social media has also enabled content creators and influencers to shape and drive gaming culture, blurring the lines between playing games and participating in a wider community. - -Cloud gaming represents another transformative trend, promising to revolutionize how games are accessed and played. Services like Google Stadia, Microsoft’s xCloud, and NVIDIA’s GeForce Now aim to make high-quality gaming accessible on a variety of devices without the need for powerful local hardware. By streaming games from remote servers, cloud gaming could democratize access to cutting-edge experiences, enabling players to enjoy high-end titles on smartphones, tablets, and other internet-connected devices. This technology has the potential to reshape the industry’s economic models, reduce the barriers to entry, and allow for more seamless and instant access to a vast library of games. - -Despite its many successes, the video game industry has not been without controversy. Issues such as crunch culture, diversity and representation, loot boxes, and the impact of violent content have all sparked significant dialogue and debate amongst players, developers, and policymakers. The industry continues to grapple with these challenges as it seeks to balance innovation and growth with ethical considerations and social responsibility. Nevertheless, video games have established themselves as a powerful medium with the capacity to entertain, educate, and inspire in ways that are unique to the interactive nature of the medium. They offer immersive experiences that can transport players to fantastical worlds, tell complex stories, and provide social connections that transcend geographical boundaries. - -The evolution of video games is a testament to the creativity, ingenuity, and passion of both developers and players. From the early, pixelated days of "Pong" to the richly detailed, expansive virtual worlds of today, video games have continuously pushed the boundaries of technology and art. As the medium evolves, it will undoubtedly continue to break new ground, offering novel experiences and forging deeper connections between players. The future of video games is limited only by the imagination of those who create and play them, and it promises to be as dynamic and innovative as the history that has brought us to this point. - -In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games. - -As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time. - -As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi" and later on "The Sims," expanding the scope of interactive entertainment beyond traditional genres. - -As technology continued to evolve, the late 1990s and early 2000s introduced another paradigm shift with the advent of 3D graphics. The fifth-generation consoles, such as the Sony PlayStation and the Nintendo 64, exploited this new capability to full effect, giving players the ability to navigate three-dimensional spaces and experience games in a novel, more immersive way. Titles such as "Super Mario 64" and "The Legend of Zelda: Ocarina of Time" became epitomes of how three-dimensional gameplay could revolutionize game design. These games offered expansive, open worlds to explore, seamlessly blending engaging mechanics with storytelling elements that gave players a sense of agency and exploration previously unattainable. The rise of 3D also heralded the beginning of cinematic storytelling in games, with titles like "Metal Gear Solid" incorporating voice acting, elaborate plots, and complex character development to create an experience akin to interactive films. - -The advent of the internet exponentially increased the reach and interactivity of video games, leading to the proliferation of massive multiplayer online games (MMOs) in the early 2000s. Titles like "World of Warcraft" created virtual worlds where millions of players could interact, cooperate, and compete in real-time. This evolution not only changed the way games were played but also formed communities that blurred the line between virtual and real worlds, creating social networks within the gaming ecosystem. The ability to play with and against others from across the globe added a new layer of engagement and longevity to the gaming experience. - -With the introduction of high-definition graphics in the mid-2000s, home consoles like the Xbox 360 and PlayStation 3 brought previously unseen levels of detail and realism to video games. This era saw the rise of popular franchises such as "Call of Duty" and "Assassin's Creed," which delivered cinematic experiences that rivaled blockbuster films. These games raised the bar for production values in terms of graphics, sound, and storytelling, creating immersive worlds that players could lose themselves in for hours on end. The emergence of digital distribution platforms like Steam also began to change the landscape of game publishing and distribution, allowing indie developers to bring innovative and unique games to the market without the backing of major publishers. This democratization of game development resulted in a broader diversity of gaming experiences, from small art-house projects to sprawling open-world epics. - -The advent of mobile gaming in the late 2000s introduced yet another seismic shift in how and where games were played. The ubiquity of smartphones brought gaming to a global audience that was previously untapped, making it an everyday activity accessible to anyone, anywhere. Casual games like "Angry Birds" and "Candy Crush Saga" became cultural phenomena, engaging a wider demographic and changing the public perception of what a video game could be. The success of mobile gaming has also led to the development of hybrid experiences, with many traditional video game franchises finding new life and audiences on mobile platforms. This era has also seen the rise of in-app purchases and microtransactions as a business model, influencing the design and monetization strategies of games across all platforms. - -Virtual reality (VR) and augmented reality (AR) technologies, though still in their relative infancy, represent the next frontier in video gaming. Devices like the Oculus Rift, HTC Vive, and PlayStation VR have begun to offer players completely immersive experiences, placing them directly within the game world. VR technology has the potential to transform not only gaming but also a host of other industries, from education to healthcare. AR games like "Pokémon GO" have demonstrated how blending the virtual with the real world can create unique and engaging experiences, bringing players together in communal activities focused on exploration and shared adventures. - -Esports has emerged as a significant cultural and economic force, with professional players and teams competing in tournaments with prize pools reaching millions of dollars. Games like "League of Legends," "Dota 2," and "Fortnite" have become global spectacles, attracting audiences that rival those of traditional sports. The rise of streaming platforms like Twitch has further facilitated the growth of esports, allowing players to build careers around broadcasting their gameplay to fans around the world. The convergence of gaming and social media has also enabled content creators and influencers to shape and drive gaming culture, blurring the lines between playing games and participating in a wider community. - -Cloud gaming represents another transformative trend, promising to revolutionize how games are accessed and played. Services like Google Stadia, Microsoft’s xCloud, and NVIDIA’s GeForce Now aim to make high-quality gaming accessible on a variety of devices without the need for powerful local hardware. By streaming games from remote servers, cloud gaming could democratize access to cutting-edge experiences, enabling players to enjoy high-end titles on smartphones, tablets, and other internet-connected devices. This technology has the potential to reshape the industry’s economic models, reduce the barriers to entry, and allow for more seamless and instant access to a vast library of games. - -Despite its many successes, the video game industry has not been without controversy. Issues such as crunch culture, diversity and representation, loot boxes, and the impact of violent content have all sparked significant dialogue and debate amongst players, developers, and policymakers. The industry continues to grapple with these challenges as it seeks to balance innovation and growth with ethical considerations and social responsibility. Nevertheless, video games have established themselves as a powerful medium with the capacity to entertain, educate, and inspire in ways that are unique to the interactive nature of the medium. They offer immersive experiences that can transport players to fantastical worlds, tell complex stories, and provide social connections that transcend geographical boundaries. - -The evolution of video games is a testament to the creativity, ingenuity, and passion of both developers and players. From the early, pixelated days of "Pong" to the richly detailed, expansive virtual worlds of today, video games have continuously pushed the boundaries of technology and art. As the medium evolves, it will undoubtedly continue to break new ground, offering novel experiences and forging deeper connections between players. The future of video games is limited only by the imagination of those who create and play them, and it promises to be as dynamic and innovative as the history that has brought us to this point. - -In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games. - -As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time. - -As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi" and later on "The Sims," expanding the scope of interactive entertainment beyond traditional genres. - -As technology continued to evolve, the late 1990s and early 2000s introduced another paradigm shift with the advent of 3D graphics. The fifth-generation consoles, such as the Sony PlayStation and the Nintendo 64, exploited this new capability to full effect, giving players the ability to navigate three-dimensional spaces and experience games in a novel, more immersive way. Titles such as "Super Mario 64" and "The Legend of Zelda: Ocarina of Time" became epitomes of how three-dimensional gameplay could revolutionize game design. These games offered expansive, open worlds to explore, seamlessly blending engaging mechanics with storytelling elements that gave players a sense of agency and exploration previously unattainable. The rise of 3D also heralded the beginning of cinematic storytelling in games, with titles like "Metal Gear Solid" incorporating voice acting, elaborate plots, and complex character development to create an experience akin to interactive films. - -The advent of the internet exponentially increased the reach and interactivity of video games, leading to the proliferation of massive multiplayer online games (MMOs) in the early 2000s. Titles like "World of Warcraft" created virtual worlds where millions of players could interact, cooperate, and compete in real-time. This evolution not only changed the way games were played but also formed communities that blurred the line between virtual and real worlds, creating social networks within the gaming ecosystem. The ability to play with and against others from across the globe added a new layer of engagement and longevity to the gaming experience. - -With the introduction of high-definition graphics in the mid-2000s, home consoles like the Xbox 360 and PlayStation 3 brought previously unseen levels of detail and realism to video games. This era saw the rise of popular franchises such as "Call of Duty" and "Assassin's Creed," which delivered cinematic experiences that rivaled blockbuster films. These games raised the bar for production values in terms of graphics, sound, and storytelling, creating immersive worlds that players could lose themselves in for hours on end. The emergence of digital distribution platforms like Steam also began to change the landscape of game publishing and distribution, allowing indie developers to bring innovative and unique games to the market without the backing of major publishers. This democratization of game development resulted in a broader diversity of gaming experiences, from small art-house projects to sprawling open-world epics. - -The advent of mobile gaming in the late 2000s introduced yet another seismic shift in how and where games were played. The ubiquity of smartphones brought gaming to a global audience that was previously untapped, making it an everyday activity accessible to anyone, anywhere. Casual games like "Angry Birds" and "Candy Crush Saga" became cultural phenomena, engaging a wider demographic and changing the public perception of what a video game could be. The success of mobile gaming has also led to the development of hybrid experiences, with many traditional video game franchises finding new life and audiences on mobile platforms. This era has also seen the rise of in-app purchases and microtransactions as a business model, influencing the design and monetization strategies of games across all platforms. - -Virtual reality (VR) and augmented reality (AR) technologies, though still in their relative infancy, represent the next frontier in video gaming. Devices like the Oculus Rift, HTC Vive, and PlayStation VR have begun to offer players completely immersive experiences, placing them directly within the game world. VR technology has the potential to transform not only gaming but also a host of other industries, from education to healthcare. AR games like "Pokémon GO" have demonstrated how blending the virtual with the real world can create unique and engaging experiences, bringing players together in communal activities focused on exploration and shared adventures. - -Esports has emerged as a significant cultural and economic force, with professional players and teams competing in tournaments with prize pools reaching millions of dollars. Games like "League of Legends," "Dota 2," and "Fortnite" have become global spectacles, attracting audiences that rival those of traditional sports. The rise of streaming platforms like Twitch has further facilitated the growth of esports, allowing players to build careers around broadcasting their gameplay to fans around the world. The convergence of gaming and social media has also enabled content creators and influencers to shape and drive gaming culture, blurring the lines between playing games and participating in a wider community. - -Cloud gaming represents another transformative trend, promising to revolutionize how games are accessed and played. Services like Google Stadia, Microsoft’s xCloud, and NVIDIA’s GeForce Now aim to make high-quality gaming accessible on a variety of devices without the need for powerful local hardware. By streaming games from remote servers, cloud gaming could democratize access to cutting-edge experiences, enabling players to enjoy high-end titles on smartphones, tablets, and other internet-connected devices. This technology has the potential to reshape the industry’s economic models, reduce the barriers to entry, and allow for more seamless and instant access to a vast library of games. - -Despite its many successes, the video game industry has not been without controversy. Issues such as crunch culture, diversity and representation, loot boxes, and the impact of violent content have all sparked significant dialogue and debate amongst players, developers, and policymakers. The industry continues to grapple with these challenges as it seeks to balance innovation and growth with ethical considerations and social responsibility. Nevertheless, video games have established themselves as a powerful medium with the capacity to entertain, educate, and inspire in ways that are unique to the interactive nature of the medium. They offer immersive experiences that can transport players to fantastical worlds, tell complex stories, and provide social connections that transcend geographical boundaries. - -The evolution of video games is a testament to the creativity, ingenuity, and passion of both developers and players. From the early, pixelated days of "Pong" to the richly detailed, expansive virtual worlds of today, video games have continuously pushed the boundaries of technology and art. As the medium evolves, it will undoubtedly continue to break new ground, offering novel experiences and forging deeper connections between players. The future of video games is limited only by the imagination of those who create and play them, and it promises to be as dynamic and innovative as the history that has brought us to this point. - -In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games. - -As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time. - -As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi". -""" - - -if __name__ == "__main__": - MODEL_NAME = "nomic-ai/nomic-embed-text-v1.5" - tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased") - long_inputs = tokenizer(long_input, return_tensors="pt", padding=True) - num_tokens = long_inputs['input_ids'].shape - - print(f"Number of tokens in the input: {num_tokens}") - - hf_model = AutoModel.from_pretrained( - MODEL_NAME, - trust_remote_code=True, - safe_serialization=True, - revision="91d2d6bfdddf0b0da840f901b533e99bae30d757", - force_download=True - ) - - onnx_path = Path("tests/nomic_bert.onnx") - onnx_config_constructor = TasksManager.get_exporter_config_constructor( - "onnx", hf_model, task="feature-extraction", library_name="transformers" - ) - onnx_config = onnx_config_constructor(hf_model.config) - onnx_inputs, onnx_outputs = export(hf_model, onnx_config, onnx_path, onnx_config.DEFAULT_ONNX_OPSET) - - print("After export") - print(onnx_inputs) - print(onnx_outputs) - - onnx_model = onnx.load(onnx_path) - onnx.checker.check_model(onnx_model) - - validate_model_outputs(onnx_config, hf_model, onnx_path, onnx_outputs, onnx_config.ATOL_FOR_VALIDATION) - - model = ORTModelForFeatureExtraction.from_pretrained( - MODEL_NAME, - file_name="onnx/model.onnx", - trust_remote_code=True, - safe_serialization=True - ) - - long_inputs_gpu = {k: v.to('cuda') for k, v in long_inputs.items()} - hf_model.to('cuda') - model.to('cuda') - - print("Testing for longer sequence length for Nomic-AI model") - optimum_model_outputs = model(**long_inputs_gpu) - hf_model_outputs = hf_model(**long_inputs_gpu) - print("Are outputs from both models close when using longer texts?", np.allclose(optimum_model_outputs.last_hidden_state.cpu().detach().numpy(), hf_model_outputs.last_hidden_state.cpu().detach().numpy(), rtol=1e-3, atol=1e-3)) - From 977fdbf25b420b182cadb44821e32f6a440d2c34 Mon Sep 17 00:00:00 2001 From: bhavika Date: Wed, 26 Jun 2024 10:41:05 -0400 Subject: [PATCH 10/28] Add nomic-bert as a supported arch in test --- tests/onnxruntime/test_modeling.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/onnxruntime/test_modeling.py b/tests/onnxruntime/test_modeling.py index b52a724f0e3..39cd4fb4cb4 100644 --- a/tests/onnxruntime/test_modeling.py +++ b/tests/onnxruntime/test_modeling.py @@ -1988,7 +1988,8 @@ class ORTModelForFeatureExtractionIntegrationTest(ORTModelTestMixin): "electra", "mpnet", "roberta", - "xlm_roberta" + "xlm_roberta", + "nomic-bert" ] FULL_GRID = {"model_arch": SUPPORTED_ARCHITECTURES} From 0b7d45924ef9131d6f7350247228d48feba2b2c7 Mon Sep 17 00:00:00 2001 From: bhavika Date: Wed, 26 Jun 2024 11:19:19 -0400 Subject: [PATCH 11/28] Add nomic-bert to large models tests --- tests/exporters/exporters_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/exporters/exporters_utils.py b/tests/exporters/exporters_utils.py index 0c52754ff60..e7e30909376 100644 --- a/tests/exporters/exporters_utils.py +++ b/tests/exporters/exporters_utils.py @@ -250,6 +250,7 @@ "mpt": "mosaicml/mpt-7b", "mt5": "lewtun/tiny-random-mt5", # Not using google/mt5-small because it takes too much time for testing. "musicgen": "facebook/musicgen-small", + "nomic-bert": "nomic-ai/nomic-embed-text-v1.5", "nystromformer": "hf-internal-testing/tiny-random-NystromformerModel", "owlv2": "google/owlv2-base-patch16", "owlvit": "google/owlvit-base-patch32", From e10b3e1731ee9bdacf2b6524fe0f9ad7e8cef6d8 Mon Sep 17 00:00:00 2001 From: bhavika Date: Thu, 27 Jun 2024 11:37:02 -0400 Subject: [PATCH 12/28] Stray space --- tests/exporters/onnx/test_exporters_onnx_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/exporters/onnx/test_exporters_onnx_cli.py b/tests/exporters/onnx/test_exporters_onnx_cli.py index 8d821e8cfe6..295fa41a209 100644 --- a/tests/exporters/onnx/test_exporters_onnx_cli.py +++ b/tests/exporters/onnx/test_exporters_onnx_cli.py @@ -735,7 +735,7 @@ def test_complex_synonyms(self): def test_custom_model(self): with TemporaryDirectory() as tmpdirname: out = subprocess.run( - f" python3 -m optimum.exporters.onnx --trust-remote-code --model nomic-ai/nomic-embed-text-v1.5 --task feature-extraction {tmpdirname}", + f"python3 -m optimum.exporters.onnx --trust-remote-code --model nomic-ai/nomic-embed-text-v1.5 --task feature-extraction {tmpdirname}", shell=True, capture_output=True, ) From 506735b6666797f4704c541d7b03efebc21f2474 Mon Sep 17 00:00:00 2001 From: bhavika Date: Sat, 13 Jul 2024 14:20:34 -0400 Subject: [PATCH 13/28] grammar --- tests/onnxruntime/test_modeling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/onnxruntime/test_modeling.py b/tests/onnxruntime/test_modeling.py index c2c9e0c9e9f..ef9168f0409 100644 --- a/tests/onnxruntime/test_modeling.py +++ b/tests/onnxruntime/test_modeling.py @@ -4704,7 +4704,7 @@ def test_generate_utils(self, test_name: str, model_arch: str, use_cache: str): @parameterized.expand(grid_parameters(FULL_GRID)) def test_compare_to_transformers(self, test_name: str, model_arch: str, use_cache: bool, use_merged: bool): if use_cache is False and use_merged is True: - self.skipTest("use_cache=False, use_merged=True are uncompatible") + self.skipTest("use_cache=False, use_merged=True are incompatible") model_args = { "test_name": test_name, From 0dea6cdaecc50dc2421975965578ddc58e6944f6 Mon Sep 17 00:00:00 2001 From: bhavika Date: Sat, 13 Jul 2024 14:31:39 -0400 Subject: [PATCH 14/28] Add nomic-bert repo --- tests/onnxruntime/utils_onnxruntime_tests.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/onnxruntime/utils_onnxruntime_tests.py b/tests/onnxruntime/utils_onnxruntime_tests.py index 65298265780..8faac0db5bb 100644 --- a/tests/onnxruntime/utils_onnxruntime_tests.py +++ b/tests/onnxruntime/utils_onnxruntime_tests.py @@ -124,6 +124,7 @@ "mpnet": "hf-internal-testing/tiny-random-MPNetModel", "mpt": "hf-internal-testing/tiny-random-MptForCausalLM", "mt5": "lewtun/tiny-random-mt5", + "nomic-bert": "nomic-ai/nomic-embed-text-v1.5", "nystromformer": "hf-internal-testing/tiny-random-NystromformerModel", "pegasus": "hf-internal-testing/tiny-random-PegasusModel", "perceiver_text": "hf-internal-testing/tiny-random-language_perceiver", From f906442b4b93c8f15882087135a7685310114dd5 Mon Sep 17 00:00:00 2001 From: bhavika Date: Sat, 13 Jul 2024 15:29:32 -0400 Subject: [PATCH 15/28] minor grammar fix --- optimum/exporters/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/optimum/exporters/tasks.py b/optimum/exporters/tasks.py index 78bdb639029..d7fdb3a1f47 100644 --- a/optimum/exporters/tasks.py +++ b/optimum/exporters/tasks.py @@ -1153,7 +1153,7 @@ def create_register( backend (`str`): The name of the backend that the register function will handle. overwrite_existing (`bool`, defaults to `False`): - Whether or not the register function is allowed to overwrite an already existing config. + Whether the register function is allowed to overwrite an already existing config. Returns: `Callable[[str, Tuple[str, ...]], Callable[[Type], Type]]`: A decorator taking the model type and a the From 5ca630e41fc3055d68f856e6d6288c020f585c0c Mon Sep 17 00:00:00 2001 From: bhavika Date: Mon, 15 Jul 2024 10:38:10 -0400 Subject: [PATCH 16/28] Remove nomic-bert from tests because we dont have a small version --- tests/exporters/exporters_utils.py | 1 - tests/onnxruntime/utils_onnxruntime_tests.py | 1 - 2 files changed, 2 deletions(-) diff --git a/tests/exporters/exporters_utils.py b/tests/exporters/exporters_utils.py index e7e30909376..0c52754ff60 100644 --- a/tests/exporters/exporters_utils.py +++ b/tests/exporters/exporters_utils.py @@ -250,7 +250,6 @@ "mpt": "mosaicml/mpt-7b", "mt5": "lewtun/tiny-random-mt5", # Not using google/mt5-small because it takes too much time for testing. "musicgen": "facebook/musicgen-small", - "nomic-bert": "nomic-ai/nomic-embed-text-v1.5", "nystromformer": "hf-internal-testing/tiny-random-NystromformerModel", "owlv2": "google/owlv2-base-patch16", "owlvit": "google/owlvit-base-patch32", diff --git a/tests/onnxruntime/utils_onnxruntime_tests.py b/tests/onnxruntime/utils_onnxruntime_tests.py index 8faac0db5bb..65298265780 100644 --- a/tests/onnxruntime/utils_onnxruntime_tests.py +++ b/tests/onnxruntime/utils_onnxruntime_tests.py @@ -124,7 +124,6 @@ "mpnet": "hf-internal-testing/tiny-random-MPNetModel", "mpt": "hf-internal-testing/tiny-random-MptForCausalLM", "mt5": "lewtun/tiny-random-mt5", - "nomic-bert": "nomic-ai/nomic-embed-text-v1.5", "nystromformer": "hf-internal-testing/tiny-random-NystromformerModel", "pegasus": "hf-internal-testing/tiny-random-PegasusModel", "perceiver_text": "hf-internal-testing/tiny-random-language_perceiver", From 801787baf7d84d854fa8b97cb2250b09aab689df Mon Sep 17 00:00:00 2001 From: bhavika Date: Mon, 15 Jul 2024 12:53:57 -0400 Subject: [PATCH 17/28] Add nomic-bert to unsuppored list --- optimum/exporters/tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/optimum/exporters/tasks.py b/optimum/exporters/tasks.py index d7fdb3a1f47..be0696c274f 100644 --- a/optimum/exporters/tasks.py +++ b/optimum/exporters/tasks.py @@ -1133,7 +1133,8 @@ class TasksManager: "vae-decoder", "clip-text-model", "clip-text-with-projection", - "trocr", # TODO: why? + "trocr", # TODO: why?, + "nomic-bert" # because there is no tiny model available } _SUPPORTED_CLI_MODEL_TYPE = ( set(_SUPPORTED_MODEL_TYPE.keys()) From b25bf323cdb0be00312e821261aa136c94da207f Mon Sep 17 00:00:00 2001 From: bhavika Date: Mon, 15 Jul 2024 12:57:25 -0400 Subject: [PATCH 18/28] Remove from unsupported --- optimum/exporters/tasks.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/optimum/exporters/tasks.py b/optimum/exporters/tasks.py index be0696c274f..d7fdb3a1f47 100644 --- a/optimum/exporters/tasks.py +++ b/optimum/exporters/tasks.py @@ -1133,8 +1133,7 @@ class TasksManager: "vae-decoder", "clip-text-model", "clip-text-with-projection", - "trocr", # TODO: why?, - "nomic-bert" # because there is no tiny model available + "trocr", # TODO: why? } _SUPPORTED_CLI_MODEL_TYPE = ( set(_SUPPORTED_MODEL_TYPE.keys()) From fe38265a5e4ebb6f500908cc34f41c8631262ab1 Mon Sep 17 00:00:00 2001 From: bhavika Date: Tue, 16 Jul 2024 21:29:36 -0400 Subject: [PATCH 19/28] Update tests to exclude nomic in tests --- optimum/exporters/onnx/base.py | 2 +- tests/exporters/exporters_utils.py | 4 ++++ tests/exporters/onnx/test_onnx_export.py | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/optimum/exporters/onnx/base.py b/optimum/exporters/onnx/base.py index 8cd94194ffe..d11d186c156 100644 --- a/optimum/exporters/onnx/base.py +++ b/optimum/exporters/onnx/base.py @@ -373,7 +373,7 @@ def is_transformers_support_available(self) -> bool: Whether the installed version of Transformers allows for the ONNX export. Returns: - `bool`: Whether the install version of Transformers is compatible with the model. + `bool`: Whether the installed version of Transformers is compatible with the model. """ return check_if_transformers_greater(self.MIN_TRANSFORMERS_VERSION) diff --git a/tests/exporters/exporters_utils.py b/tests/exporters/exporters_utils.py index 0c52754ff60..400328fae1f 100644 --- a/tests/exporters/exporters_utils.py +++ b/tests/exporters/exporters_utils.py @@ -299,6 +299,10 @@ "stable-diffusion-xl": "echarlaix/tiny-random-stable-diffusion-xl", } +PYTORCH_REMOTE_CODE_MODELS = { + "nomic-bert": "nomic-ai/nomic-embed-text-v1.5" +} + PYTORCH_TIMM_MODEL = { "default-timm-config": { "timm/inception_v3.tf_adv_in1k": ["image-classification"], diff --git a/tests/exporters/onnx/test_onnx_export.py b/tests/exporters/onnx/test_onnx_export.py index 9eddc4c86de..6752f60a7e5 100644 --- a/tests/exporters/onnx/test_onnx_export.py +++ b/tests/exporters/onnx/test_onnx_export.py @@ -51,6 +51,7 @@ PYTORCH_EXPORT_MODELS_TINY, PYTORCH_SENTENCE_TRANSFORMERS_MODEL, PYTORCH_STABLE_DIFFUSION_MODEL, + PYTORCH_REMOTE_CODE_MODELS, PYTORCH_TIMM_MODEL, TENSORFLOW_EXPORT_MODELS, VALIDATE_EXPORT_ON_SHAPES_SLOW, @@ -197,7 +198,8 @@ def _onnx_export( return onnx_config = onnx_config_class_constructor(model.config) - + print("Got this ONNX config") + print(onnx_config) # We need to set this to some value to be able to test the outputs values for batch size > 1. if ( isinstance(onnx_config, OnnxConfigWithPast) @@ -323,6 +325,7 @@ def test_all_models_tested(self): - set(PYTORCH_EXPORT_MODELS_TINY.keys()) - set(PYTORCH_TIMM_MODEL.keys()) - set(PYTORCH_SENTENCE_TRANSFORMERS_MODEL.keys()) + - set(PYTORCH_REMOTE_CODE_MODELS.keys()) ) if len(missing_models_set) > 0: self.fail(f"Not testing all models. Missing models: {missing_models_set}") From 7f6a562e9718d1070a342526e64082ad3e5b39e5 Mon Sep 17 00:00:00 2001 From: bhavika Date: Tue, 16 Jul 2024 21:54:35 -0400 Subject: [PATCH 20/28] Modify test-custom-model --- .../exporters/onnx/test_exporters_onnx_cli.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/exporters/onnx/test_exporters_onnx_cli.py b/tests/exporters/onnx/test_exporters_onnx_cli.py index 295fa41a209..a55b5dc8108 100644 --- a/tests/exporters/onnx/test_exporters_onnx_cli.py +++ b/tests/exporters/onnx/test_exporters_onnx_cli.py @@ -47,6 +47,7 @@ PYTORCH_TIMM_MODEL, PYTORCH_TIMM_MODEL_NO_DYNAMIC_AXES, PYTORCH_TRANSFORMERS_MODEL_NO_DYNAMIC_AXES, + PYTORCH_REMOTE_CODE_MODELS ) @@ -731,11 +732,23 @@ def test_complex_synonyms(self): main_export(model_name_or_path=tmpdir_in, output=tmpdir_out, task="text-classification") + @parameterized.expand(_get_models_to_test(PYTORCH_REMOTE_CODE_MODELS, library_name="transformers")) + @require_torch @slow - def test_custom_model(self): + @pytest.mark.run_slow + def test_custom_model( + self, + test_name: str, + model_type: str, + model_name: str, + task: str, + variant: str, + monolith: bool, + no_post_process: bool, + ): with TemporaryDirectory() as tmpdirname: out = subprocess.run( - f"python3 -m optimum.exporters.onnx --trust-remote-code --model nomic-ai/nomic-embed-text-v1.5 --task feature-extraction {tmpdirname}", + f"python3 -m optimum.exporters.onnx --trust-remote-code --model {model_name} --task {task} {tmpdirname}", shell=True, capture_output=True, ) @@ -743,7 +756,7 @@ def test_custom_model(self): with TemporaryDirectory() as tmpdirname: out = subprocess.run( - f"python3 -m optimum.exporters.onnx --trust-remote-code --model nomic-ai/nomic-embed-text-v1.5 --task feature-extraction {tmpdirname}", + f"python3 -m optimum.exporters.onnx --trust-remote-code --model {model_name} --task {task} {tmpdirname}", shell=True, check=True, ) \ No newline at end of file From 3fe0e46c7617ca81f7a981896a7400b71faa94fb Mon Sep 17 00:00:00 2001 From: bhavika Date: Wed, 17 Jul 2024 08:25:04 -0400 Subject: [PATCH 21/28] Remove debugging statement --- tests/exporters/onnx/test_onnx_export.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/exporters/onnx/test_onnx_export.py b/tests/exporters/onnx/test_onnx_export.py index 6752f60a7e5..46ace4157a6 100644 --- a/tests/exporters/onnx/test_onnx_export.py +++ b/tests/exporters/onnx/test_onnx_export.py @@ -198,8 +198,7 @@ def _onnx_export( return onnx_config = onnx_config_class_constructor(model.config) - print("Got this ONNX config") - print(onnx_config) + # We need to set this to some value to be able to test the outputs values for batch size > 1. if ( isinstance(onnx_config, OnnxConfigWithPast) From 6252618ab783c16f89635cd753d1c74c95a2329c Mon Sep 17 00:00:00 2001 From: bhavika Date: Wed, 17 Jul 2024 08:27:52 -0400 Subject: [PATCH 22/28] Formatting --- optimum/exporters/tasks.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/optimum/exporters/tasks.py b/optimum/exporters/tasks.py index d7fdb3a1f47..c0ec64b044e 100644 --- a/optimum/exporters/tasks.py +++ b/optimum/exporters/tasks.py @@ -828,7 +828,10 @@ class TasksManager: "text2text-generation-with-past", onnx="M2M100OnnxConfig", ), - "nomic-bert": supported_tasks_mapping("feature-extraction", onnx="NomicBertOnnxConfig"), + "nomic-bert": supported_tasks_mapping( + "feature-extraction", + onnx="NomicBertOnnxConfig" + ), "nystromformer": supported_tasks_mapping( "feature-extraction", "fill-mask", From dc948c6c2ec2e2b1e523221b3a6afc001fd49552 Mon Sep 17 00:00:00 2001 From: bhavika Date: Fri, 19 Jul 2024 11:03:53 -0400 Subject: [PATCH 23/28] Formatting with black --- optimum/exporters/tasks.py | 5 +---- tests/exporters/exporters_utils.py | 4 +--- .../exporters/onnx/test_exporters_onnx_cli.py | 20 +++++++++---------- tests/exporters/onnx/test_onnx_export.py | 1 - tests/onnxruntime/test_modeling.py | 2 +- 5 files changed, 13 insertions(+), 19 deletions(-) diff --git a/optimum/exporters/tasks.py b/optimum/exporters/tasks.py index 4bfe652a93a..3c52acdcfc9 100644 --- a/optimum/exporters/tasks.py +++ b/optimum/exporters/tasks.py @@ -869,10 +869,7 @@ class TasksManager: "text2text-generation-with-past", onnx="M2M100OnnxConfig", ), - "nomic-bert": supported_tasks_mapping( - "feature-extraction", - onnx="NomicBertOnnxConfig" - ), + "nomic-bert": supported_tasks_mapping("feature-extraction", onnx="NomicBertOnnxConfig"), "nystromformer": supported_tasks_mapping( "feature-extraction", "fill-mask", diff --git a/tests/exporters/exporters_utils.py b/tests/exporters/exporters_utils.py index 0ef7779cb55..ef05f992400 100644 --- a/tests/exporters/exporters_utils.py +++ b/tests/exporters/exporters_utils.py @@ -301,9 +301,7 @@ "lcm": "echarlaix/tiny-random-latent-consistency", } -PYTORCH_REMOTE_CODE_MODELS = { - "nomic-bert": "nomic-ai/nomic-embed-text-v1.5" -} +PYTORCH_REMOTE_CODE_MODELS = {"nomic-bert": "nomic-ai/nomic-embed-text-v1.5"} PYTORCH_TIMM_MODEL = { "default-timm-config": { diff --git a/tests/exporters/onnx/test_exporters_onnx_cli.py b/tests/exporters/onnx/test_exporters_onnx_cli.py index d4584bd06e0..9972781706d 100644 --- a/tests/exporters/onnx/test_exporters_onnx_cli.py +++ b/tests/exporters/onnx/test_exporters_onnx_cli.py @@ -47,7 +47,7 @@ PYTORCH_TIMM_MODEL, PYTORCH_TIMM_MODEL_NO_DYNAMIC_AXES, PYTORCH_TRANSFORMERS_MODEL_NO_DYNAMIC_AXES, - PYTORCH_REMOTE_CODE_MODELS + PYTORCH_REMOTE_CODE_MODELS, ) @@ -737,14 +737,14 @@ def test_complex_synonyms(self): @slow @pytest.mark.run_slow def test_custom_model( - self, - test_name: str, - model_type: str, - model_name: str, - task: str, - variant: str, - monolith: bool, - no_post_process: bool, + self, + test_name: str, + model_type: str, + model_name: str, + task: str, + variant: str, + monolith: bool, + no_post_process: bool, ): with TemporaryDirectory() as tmpdirname: out = subprocess.run( @@ -759,4 +759,4 @@ def test_custom_model( f"python3 -m optimum.exporters.onnx --trust-remote-code --model {model_name} --task {task} {tmpdirname}", shell=True, check=True, - ) \ No newline at end of file + ) diff --git a/tests/exporters/onnx/test_onnx_export.py b/tests/exporters/onnx/test_onnx_export.py index 6065100f0df..c4969f3bc6a 100644 --- a/tests/exporters/onnx/test_onnx_export.py +++ b/tests/exporters/onnx/test_onnx_export.py @@ -51,7 +51,6 @@ PYTORCH_DIFFUSION_MODEL, PYTORCH_EXPORT_MODELS_TINY, PYTORCH_SENTENCE_TRANSFORMERS_MODEL, - PYTORCH_STABLE_DIFFUSION_MODEL, PYTORCH_REMOTE_CODE_MODELS, PYTORCH_TIMM_MODEL, TENSORFLOW_EXPORT_MODELS, diff --git a/tests/onnxruntime/test_modeling.py b/tests/onnxruntime/test_modeling.py index e66047fbdd3..dce5d9f3d91 100644 --- a/tests/onnxruntime/test_modeling.py +++ b/tests/onnxruntime/test_modeling.py @@ -1987,7 +1987,7 @@ class ORTModelForFeatureExtractionIntegrationTest(ORTModelTestMixin): "mpnet", "roberta", "xlm_roberta", - "nomic-bert" + "nomic-bert", ] FULL_GRID = {"model_arch": SUPPORTED_ARCHITECTURES} From 1b26f3fda80223736e3be4e8f8d00e20c523bb71 Mon Sep 17 00:00:00 2001 From: bhavika Date: Sun, 4 Aug 2024 16:36:13 -0400 Subject: [PATCH 24/28] Ruff formatting --- tests/exporters/onnx/test_exporters_onnx_cli.py | 2 +- tests/exporters/onnx/test_onnx_export.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/exporters/onnx/test_exporters_onnx_cli.py b/tests/exporters/onnx/test_exporters_onnx_cli.py index 9972781706d..496af2d810c 100644 --- a/tests/exporters/onnx/test_exporters_onnx_cli.py +++ b/tests/exporters/onnx/test_exporters_onnx_cli.py @@ -43,11 +43,11 @@ NO_DYNAMIC_AXES_EXPORT_SHAPES_TRANSFORMERS, PYTORCH_DIFFUSION_MODEL, PYTORCH_EXPORT_MODELS_TINY, + PYTORCH_REMOTE_CODE_MODELS, PYTORCH_SENTENCE_TRANSFORMERS_MODEL, PYTORCH_TIMM_MODEL, PYTORCH_TIMM_MODEL_NO_DYNAMIC_AXES, PYTORCH_TRANSFORMERS_MODEL_NO_DYNAMIC_AXES, - PYTORCH_REMOTE_CODE_MODELS, ) diff --git a/tests/exporters/onnx/test_onnx_export.py b/tests/exporters/onnx/test_onnx_export.py index c4969f3bc6a..097b3077bcf 100644 --- a/tests/exporters/onnx/test_onnx_export.py +++ b/tests/exporters/onnx/test_onnx_export.py @@ -50,8 +50,8 @@ from ..exporters_utils import ( PYTORCH_DIFFUSION_MODEL, PYTORCH_EXPORT_MODELS_TINY, - PYTORCH_SENTENCE_TRANSFORMERS_MODEL, PYTORCH_REMOTE_CODE_MODELS, + PYTORCH_SENTENCE_TRANSFORMERS_MODEL, PYTORCH_TIMM_MODEL, TENSORFLOW_EXPORT_MODELS, VALIDATE_EXPORT_ON_SHAPES_SLOW, From 35f5ea26de197bce16ae1bb307d427be065f33ca Mon Sep 17 00:00:00 2001 From: bhavika Date: Sun, 4 Aug 2024 17:02:52 -0400 Subject: [PATCH 25/28] Remove nomic-bert as a supported arch --- tests/onnxruntime/test_modeling.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/onnxruntime/test_modeling.py b/tests/onnxruntime/test_modeling.py index dce5d9f3d91..a9b7124ab2e 100644 --- a/tests/onnxruntime/test_modeling.py +++ b/tests/onnxruntime/test_modeling.py @@ -1986,8 +1986,7 @@ class ORTModelForFeatureExtractionIntegrationTest(ORTModelTestMixin): "electra", "mpnet", "roberta", - "xlm_roberta", - "nomic-bert", + "xlm_roberta" ] FULL_GRID = {"model_arch": SUPPORTED_ARCHITECTURES} From 0b6aa14b9e274122c0072c8fc0924ec2a23680f9 Mon Sep 17 00:00:00 2001 From: bhavika Date: Sun, 22 Sep 2024 17:35:20 -0400 Subject: [PATCH 26/28] Fix formatting --- optimum/onnxruntime/runs/__init__.py | 6 +++--- tests/onnxruntime/test_modeling.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/optimum/onnxruntime/runs/__init__.py b/optimum/onnxruntime/runs/__init__.py index 1d982949344..d21db2a4aca 100644 --- a/optimum/onnxruntime/runs/__init__.py +++ b/optimum/onnxruntime/runs/__init__.py @@ -110,9 +110,9 @@ def __init__(self, run_config): model_class = FeaturesManager.get_model_class_for_feature(get_autoclass_name(self.task)) self.torch_model = model_class.from_pretrained(run_config["model_name_or_path"]) - self.return_body[ - "model_type" - ] = self.torch_model.config.model_type # return_body is initialized in parent class + self.return_body["model_type"] = ( + self.torch_model.config.model_type + ) # return_body is initialized in parent class def _launch_time(self, trial): batch_size = trial.suggest_categorical("batch_size", self.batch_sizes) diff --git a/tests/onnxruntime/test_modeling.py b/tests/onnxruntime/test_modeling.py index a9b7124ab2e..34142149e07 100644 --- a/tests/onnxruntime/test_modeling.py +++ b/tests/onnxruntime/test_modeling.py @@ -1986,7 +1986,7 @@ class ORTModelForFeatureExtractionIntegrationTest(ORTModelTestMixin): "electra", "mpnet", "roberta", - "xlm_roberta" + "xlm_roberta", ] FULL_GRID = {"model_arch": SUPPORTED_ARCHITECTURES} From 974e625f2d4d4ee73df5dc56a49e2b6a920f2ab4 Mon Sep 17 00:00:00 2001 From: bhavika Date: Mon, 21 Oct 2024 08:55:16 -0400 Subject: [PATCH 27/28] Run black --- optimum/onnxruntime/runs/__init__.py | 6 +- tests/nomic_bert.py | 166 +++++++++++++++++++++++++++ 2 files changed, 169 insertions(+), 3 deletions(-) create mode 100644 tests/nomic_bert.py diff --git a/optimum/onnxruntime/runs/__init__.py b/optimum/onnxruntime/runs/__init__.py index d21db2a4aca..1d982949344 100644 --- a/optimum/onnxruntime/runs/__init__.py +++ b/optimum/onnxruntime/runs/__init__.py @@ -110,9 +110,9 @@ def __init__(self, run_config): model_class = FeaturesManager.get_model_class_for_feature(get_autoclass_name(self.task)) self.torch_model = model_class.from_pretrained(run_config["model_name_or_path"]) - self.return_body["model_type"] = ( - self.torch_model.config.model_type - ) # return_body is initialized in parent class + self.return_body[ + "model_type" + ] = self.torch_model.config.model_type # return_body is initialized in parent class def _launch_time(self, trial): batch_size = trial.suggest_categorical("batch_size", self.batch_sizes) diff --git a/tests/nomic_bert.py b/tests/nomic_bert.py new file mode 100644 index 00000000000..01945b1a2f3 --- /dev/null +++ b/tests/nomic_bert.py @@ -0,0 +1,166 @@ +import numpy as np +from transformers import AutoTokenizer, AutoModel +from pathlib import Path +from optimum.exporters import TasksManager +from optimum.exporters.onnx import export +import onnx +from optimum.exporters.onnx import validate_model_outputs +from optimum.onnxruntime import ORTModelForFeatureExtraction + + +long_input = """ +In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games. + +As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time. + +As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi" and later on "The Sims," expanding the scope of interactive entertainment beyond traditional genres. + +As technology continued to evolve, the late 1990s and early 2000s introduced another paradigm shift with the advent of 3D graphics. The fifth-generation consoles, such as the Sony PlayStation and the Nintendo 64, exploited this new capability to full effect, giving players the ability to navigate three-dimensional spaces and experience games in a novel, more immersive way. Titles such as "Super Mario 64" and "The Legend of Zelda: Ocarina of Time" became epitomes of how three-dimensional gameplay could revolutionize game design. These games offered expansive, open worlds to explore, seamlessly blending engaging mechanics with storytelling elements that gave players a sense of agency and exploration previously unattainable. The rise of 3D also heralded the beginning of cinematic storytelling in games, with titles like "Metal Gear Solid" incorporating voice acting, elaborate plots, and complex character development to create an experience akin to interactive films. + +The advent of the internet exponentially increased the reach and interactivity of video games, leading to the proliferation of massive multiplayer online games (MMOs) in the early 2000s. Titles like "World of Warcraft" created virtual worlds where millions of players could interact, cooperate, and compete in real-time. This evolution not only changed the way games were played but also formed communities that blurred the line between virtual and real worlds, creating social networks within the gaming ecosystem. The ability to play with and against others from across the globe added a new layer of engagement and longevity to the gaming experience. + +With the introduction of high-definition graphics in the mid-2000s, home consoles like the Xbox 360 and PlayStation 3 brought previously unseen levels of detail and realism to video games. This era saw the rise of popular franchises such as "Call of Duty" and "Assassin's Creed," which delivered cinematic experiences that rivaled blockbuster films. These games raised the bar for production values in terms of graphics, sound, and storytelling, creating immersive worlds that players could lose themselves in for hours on end. The emergence of digital distribution platforms like Steam also began to change the landscape of game publishing and distribution, allowing indie developers to bring innovative and unique games to the market without the backing of major publishers. This democratization of game development resulted in a broader diversity of gaming experiences, from small art-house projects to sprawling open-world epics. + +The advent of mobile gaming in the late 2000s introduced yet another seismic shift in how and where games were played. The ubiquity of smartphones brought gaming to a global audience that was previously untapped, making it an everyday activity accessible to anyone, anywhere. Casual games like "Angry Birds" and "Candy Crush Saga" became cultural phenomena, engaging a wider demographic and changing the public perception of what a video game could be. The success of mobile gaming has also led to the development of hybrid experiences, with many traditional video game franchises finding new life and audiences on mobile platforms. This era has also seen the rise of in-app purchases and microtransactions as a business model, influencing the design and monetization strategies of games across all platforms. + +Virtual reality (VR) and augmented reality (AR) technologies, though still in their relative infancy, represent the next frontier in video gaming. Devices like the Oculus Rift, HTC Vive, and PlayStation VR have begun to offer players completely immersive experiences, placing them directly within the game world. VR technology has the potential to transform not only gaming but also a host of other industries, from education to healthcare. AR games like "Pokémon GO" have demonstrated how blending the virtual with the real world can create unique and engaging experiences, bringing players together in communal activities focused on exploration and shared adventures. + +Esports has emerged as a significant cultural and economic force, with professional players and teams competing in tournaments with prize pools reaching millions of dollars. Games like "League of Legends," "Dota 2," and "Fortnite" have become global spectacles, attracting audiences that rival those of traditional sports. The rise of streaming platforms like Twitch has further facilitated the growth of esports, allowing players to build careers around broadcasting their gameplay to fans around the world. The convergence of gaming and social media has also enabled content creators and influencers to shape and drive gaming culture, blurring the lines between playing games and participating in a wider community. + +Cloud gaming represents another transformative trend, promising to revolutionize how games are accessed and played. Services like Google Stadia, Microsoft’s xCloud, and NVIDIA’s GeForce Now aim to make high-quality gaming accessible on a variety of devices without the need for powerful local hardware. By streaming games from remote servers, cloud gaming could democratize access to cutting-edge experiences, enabling players to enjoy high-end titles on smartphones, tablets, and other internet-connected devices. This technology has the potential to reshape the industry’s economic models, reduce the barriers to entry, and allow for more seamless and instant access to a vast library of games. + +Despite its many successes, the video game industry has not been without controversy. Issues such as crunch culture, diversity and representation, loot boxes, and the impact of violent content have all sparked significant dialogue and debate amongst players, developers, and policymakers. The industry continues to grapple with these challenges as it seeks to balance innovation and growth with ethical considerations and social responsibility. Nevertheless, video games have established themselves as a powerful medium with the capacity to entertain, educate, and inspire in ways that are unique to the interactive nature of the medium. They offer immersive experiences that can transport players to fantastical worlds, tell complex stories, and provide social connections that transcend geographical boundaries. + +The evolution of video games is a testament to the creativity, ingenuity, and passion of both developers and players. From the early, pixelated days of "Pong" to the richly detailed, expansive virtual worlds of today, video games have continuously pushed the boundaries of technology and art. As the medium evolves, it will undoubtedly continue to break new ground, offering novel experiences and forging deeper connections between players. The future of video games is limited only by the imagination of those who create and play them, and it promises to be as dynamic and innovative as the history that has brought us to this point. + +In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games. + +As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time. + +As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi" and later on "The Sims," expanding the scope of interactive entertainment beyond traditional genres. + +As technology continued to evolve, the late 1990s and early 2000s introduced another paradigm shift with the advent of 3D graphics. The fifth-generation consoles, such as the Sony PlayStation and the Nintendo 64, exploited this new capability to full effect, giving players the ability to navigate three-dimensional spaces and experience games in a novel, more immersive way. Titles such as "Super Mario 64" and "The Legend of Zelda: Ocarina of Time" became epitomes of how three-dimensional gameplay could revolutionize game design. These games offered expansive, open worlds to explore, seamlessly blending engaging mechanics with storytelling elements that gave players a sense of agency and exploration previously unattainable. The rise of 3D also heralded the beginning of cinematic storytelling in games, with titles like "Metal Gear Solid" incorporating voice acting, elaborate plots, and complex character development to create an experience akin to interactive films. + +The advent of the internet exponentially increased the reach and interactivity of video games, leading to the proliferation of massive multiplayer online games (MMOs) in the early 2000s. Titles like "World of Warcraft" created virtual worlds where millions of players could interact, cooperate, and compete in real-time. This evolution not only changed the way games were played but also formed communities that blurred the line between virtual and real worlds, creating social networks within the gaming ecosystem. The ability to play with and against others from across the globe added a new layer of engagement and longevity to the gaming experience. + +With the introduction of high-definition graphics in the mid-2000s, home consoles like the Xbox 360 and PlayStation 3 brought previously unseen levels of detail and realism to video games. This era saw the rise of popular franchises such as "Call of Duty" and "Assassin's Creed," which delivered cinematic experiences that rivaled blockbuster films. These games raised the bar for production values in terms of graphics, sound, and storytelling, creating immersive worlds that players could lose themselves in for hours on end. The emergence of digital distribution platforms like Steam also began to change the landscape of game publishing and distribution, allowing indie developers to bring innovative and unique games to the market without the backing of major publishers. This democratization of game development resulted in a broader diversity of gaming experiences, from small art-house projects to sprawling open-world epics. + +The advent of mobile gaming in the late 2000s introduced yet another seismic shift in how and where games were played. The ubiquity of smartphones brought gaming to a global audience that was previously untapped, making it an everyday activity accessible to anyone, anywhere. Casual games like "Angry Birds" and "Candy Crush Saga" became cultural phenomena, engaging a wider demographic and changing the public perception of what a video game could be. The success of mobile gaming has also led to the development of hybrid experiences, with many traditional video game franchises finding new life and audiences on mobile platforms. This era has also seen the rise of in-app purchases and microtransactions as a business model, influencing the design and monetization strategies of games across all platforms. + +Virtual reality (VR) and augmented reality (AR) technologies, though still in their relative infancy, represent the next frontier in video gaming. Devices like the Oculus Rift, HTC Vive, and PlayStation VR have begun to offer players completely immersive experiences, placing them directly within the game world. VR technology has the potential to transform not only gaming but also a host of other industries, from education to healthcare. AR games like "Pokémon GO" have demonstrated how blending the virtual with the real world can create unique and engaging experiences, bringing players together in communal activities focused on exploration and shared adventures. + +Esports has emerged as a significant cultural and economic force, with professional players and teams competing in tournaments with prize pools reaching millions of dollars. Games like "League of Legends," "Dota 2," and "Fortnite" have become global spectacles, attracting audiences that rival those of traditional sports. The rise of streaming platforms like Twitch has further facilitated the growth of esports, allowing players to build careers around broadcasting their gameplay to fans around the world. The convergence of gaming and social media has also enabled content creators and influencers to shape and drive gaming culture, blurring the lines between playing games and participating in a wider community. + +Cloud gaming represents another transformative trend, promising to revolutionize how games are accessed and played. Services like Google Stadia, Microsoft’s xCloud, and NVIDIA’s GeForce Now aim to make high-quality gaming accessible on a variety of devices without the need for powerful local hardware. By streaming games from remote servers, cloud gaming could democratize access to cutting-edge experiences, enabling players to enjoy high-end titles on smartphones, tablets, and other internet-connected devices. This technology has the potential to reshape the industry’s economic models, reduce the barriers to entry, and allow for more seamless and instant access to a vast library of games. + +Despite its many successes, the video game industry has not been without controversy. Issues such as crunch culture, diversity and representation, loot boxes, and the impact of violent content have all sparked significant dialogue and debate amongst players, developers, and policymakers. The industry continues to grapple with these challenges as it seeks to balance innovation and growth with ethical considerations and social responsibility. Nevertheless, video games have established themselves as a powerful medium with the capacity to entertain, educate, and inspire in ways that are unique to the interactive nature of the medium. They offer immersive experiences that can transport players to fantastical worlds, tell complex stories, and provide social connections that transcend geographical boundaries. + +The evolution of video games is a testament to the creativity, ingenuity, and passion of both developers and players. From the early, pixelated days of "Pong" to the richly detailed, expansive virtual worlds of today, video games have continuously pushed the boundaries of technology and art. As the medium evolves, it will undoubtedly continue to break new ground, offering novel experiences and forging deeper connections between players. The future of video games is limited only by the imagination of those who create and play them, and it promises to be as dynamic and innovative as the history that has brought us to this point. + +In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games. + +As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time. + +As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi" and later on "The Sims," expanding the scope of interactive entertainment beyond traditional genres. + +As technology continued to evolve, the late 1990s and early 2000s introduced another paradigm shift with the advent of 3D graphics. The fifth-generation consoles, such as the Sony PlayStation and the Nintendo 64, exploited this new capability to full effect, giving players the ability to navigate three-dimensional spaces and experience games in a novel, more immersive way. Titles such as "Super Mario 64" and "The Legend of Zelda: Ocarina of Time" became epitomes of how three-dimensional gameplay could revolutionize game design. These games offered expansive, open worlds to explore, seamlessly blending engaging mechanics with storytelling elements that gave players a sense of agency and exploration previously unattainable. The rise of 3D also heralded the beginning of cinematic storytelling in games, with titles like "Metal Gear Solid" incorporating voice acting, elaborate plots, and complex character development to create an experience akin to interactive films. + +The advent of the internet exponentially increased the reach and interactivity of video games, leading to the proliferation of massive multiplayer online games (MMOs) in the early 2000s. Titles like "World of Warcraft" created virtual worlds where millions of players could interact, cooperate, and compete in real-time. This evolution not only changed the way games were played but also formed communities that blurred the line between virtual and real worlds, creating social networks within the gaming ecosystem. The ability to play with and against others from across the globe added a new layer of engagement and longevity to the gaming experience. + +With the introduction of high-definition graphics in the mid-2000s, home consoles like the Xbox 360 and PlayStation 3 brought previously unseen levels of detail and realism to video games. This era saw the rise of popular franchises such as "Call of Duty" and "Assassin's Creed," which delivered cinematic experiences that rivaled blockbuster films. These games raised the bar for production values in terms of graphics, sound, and storytelling, creating immersive worlds that players could lose themselves in for hours on end. The emergence of digital distribution platforms like Steam also began to change the landscape of game publishing and distribution, allowing indie developers to bring innovative and unique games to the market without the backing of major publishers. This democratization of game development resulted in a broader diversity of gaming experiences, from small art-house projects to sprawling open-world epics. + +The advent of mobile gaming in the late 2000s introduced yet another seismic shift in how and where games were played. The ubiquity of smartphones brought gaming to a global audience that was previously untapped, making it an everyday activity accessible to anyone, anywhere. Casual games like "Angry Birds" and "Candy Crush Saga" became cultural phenomena, engaging a wider demographic and changing the public perception of what a video game could be. The success of mobile gaming has also led to the development of hybrid experiences, with many traditional video game franchises finding new life and audiences on mobile platforms. This era has also seen the rise of in-app purchases and microtransactions as a business model, influencing the design and monetization strategies of games across all platforms. + +Virtual reality (VR) and augmented reality (AR) technologies, though still in their relative infancy, represent the next frontier in video gaming. Devices like the Oculus Rift, HTC Vive, and PlayStation VR have begun to offer players completely immersive experiences, placing them directly within the game world. VR technology has the potential to transform not only gaming but also a host of other industries, from education to healthcare. AR games like "Pokémon GO" have demonstrated how blending the virtual with the real world can create unique and engaging experiences, bringing players together in communal activities focused on exploration and shared adventures. + +Esports has emerged as a significant cultural and economic force, with professional players and teams competing in tournaments with prize pools reaching millions of dollars. Games like "League of Legends," "Dota 2," and "Fortnite" have become global spectacles, attracting audiences that rival those of traditional sports. The rise of streaming platforms like Twitch has further facilitated the growth of esports, allowing players to build careers around broadcasting their gameplay to fans around the world. The convergence of gaming and social media has also enabled content creators and influencers to shape and drive gaming culture, blurring the lines between playing games and participating in a wider community. + +Cloud gaming represents another transformative trend, promising to revolutionize how games are accessed and played. Services like Google Stadia, Microsoft’s xCloud, and NVIDIA’s GeForce Now aim to make high-quality gaming accessible on a variety of devices without the need for powerful local hardware. By streaming games from remote servers, cloud gaming could democratize access to cutting-edge experiences, enabling players to enjoy high-end titles on smartphones, tablets, and other internet-connected devices. This technology has the potential to reshape the industry’s economic models, reduce the barriers to entry, and allow for more seamless and instant access to a vast library of games. + +Despite its many successes, the video game industry has not been without controversy. Issues such as crunch culture, diversity and representation, loot boxes, and the impact of violent content have all sparked significant dialogue and debate amongst players, developers, and policymakers. The industry continues to grapple with these challenges as it seeks to balance innovation and growth with ethical considerations and social responsibility. Nevertheless, video games have established themselves as a powerful medium with the capacity to entertain, educate, and inspire in ways that are unique to the interactive nature of the medium. They offer immersive experiences that can transport players to fantastical worlds, tell complex stories, and provide social connections that transcend geographical boundaries. + +The evolution of video games is a testament to the creativity, ingenuity, and passion of both developers and players. From the early, pixelated days of "Pong" to the richly detailed, expansive virtual worlds of today, video games have continuously pushed the boundaries of technology and art. As the medium evolves, it will undoubtedly continue to break new ground, offering novel experiences and forging deeper connections between players. The future of video games is limited only by the imagination of those who create and play them, and it promises to be as dynamic and innovative as the history that has brought us to this point. + +In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games. + +As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time. + +As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi" and later on "The Sims," expanding the scope of interactive entertainment beyond traditional genres. + +As technology continued to evolve, the late 1990s and early 2000s introduced another paradigm shift with the advent of 3D graphics. The fifth-generation consoles, such as the Sony PlayStation and the Nintendo 64, exploited this new capability to full effect, giving players the ability to navigate three-dimensional spaces and experience games in a novel, more immersive way. Titles such as "Super Mario 64" and "The Legend of Zelda: Ocarina of Time" became epitomes of how three-dimensional gameplay could revolutionize game design. These games offered expansive, open worlds to explore, seamlessly blending engaging mechanics with storytelling elements that gave players a sense of agency and exploration previously unattainable. The rise of 3D also heralded the beginning of cinematic storytelling in games, with titles like "Metal Gear Solid" incorporating voice acting, elaborate plots, and complex character development to create an experience akin to interactive films. + +The advent of the internet exponentially increased the reach and interactivity of video games, leading to the proliferation of massive multiplayer online games (MMOs) in the early 2000s. Titles like "World of Warcraft" created virtual worlds where millions of players could interact, cooperate, and compete in real-time. This evolution not only changed the way games were played but also formed communities that blurred the line between virtual and real worlds, creating social networks within the gaming ecosystem. The ability to play with and against others from across the globe added a new layer of engagement and longevity to the gaming experience. + +With the introduction of high-definition graphics in the mid-2000s, home consoles like the Xbox 360 and PlayStation 3 brought previously unseen levels of detail and realism to video games. This era saw the rise of popular franchises such as "Call of Duty" and "Assassin's Creed," which delivered cinematic experiences that rivaled blockbuster films. These games raised the bar for production values in terms of graphics, sound, and storytelling, creating immersive worlds that players could lose themselves in for hours on end. The emergence of digital distribution platforms like Steam also began to change the landscape of game publishing and distribution, allowing indie developers to bring innovative and unique games to the market without the backing of major publishers. This democratization of game development resulted in a broader diversity of gaming experiences, from small art-house projects to sprawling open-world epics. + +The advent of mobile gaming in the late 2000s introduced yet another seismic shift in how and where games were played. The ubiquity of smartphones brought gaming to a global audience that was previously untapped, making it an everyday activity accessible to anyone, anywhere. Casual games like "Angry Birds" and "Candy Crush Saga" became cultural phenomena, engaging a wider demographic and changing the public perception of what a video game could be. The success of mobile gaming has also led to the development of hybrid experiences, with many traditional video game franchises finding new life and audiences on mobile platforms. This era has also seen the rise of in-app purchases and microtransactions as a business model, influencing the design and monetization strategies of games across all platforms. + +Virtual reality (VR) and augmented reality (AR) technologies, though still in their relative infancy, represent the next frontier in video gaming. Devices like the Oculus Rift, HTC Vive, and PlayStation VR have begun to offer players completely immersive experiences, placing them directly within the game world. VR technology has the potential to transform not only gaming but also a host of other industries, from education to healthcare. AR games like "Pokémon GO" have demonstrated how blending the virtual with the real world can create unique and engaging experiences, bringing players together in communal activities focused on exploration and shared adventures. + +Esports has emerged as a significant cultural and economic force, with professional players and teams competing in tournaments with prize pools reaching millions of dollars. Games like "League of Legends," "Dota 2," and "Fortnite" have become global spectacles, attracting audiences that rival those of traditional sports. The rise of streaming platforms like Twitch has further facilitated the growth of esports, allowing players to build careers around broadcasting their gameplay to fans around the world. The convergence of gaming and social media has also enabled content creators and influencers to shape and drive gaming culture, blurring the lines between playing games and participating in a wider community. + +Cloud gaming represents another transformative trend, promising to revolutionize how games are accessed and played. Services like Google Stadia, Microsoft’s xCloud, and NVIDIA’s GeForce Now aim to make high-quality gaming accessible on a variety of devices without the need for powerful local hardware. By streaming games from remote servers, cloud gaming could democratize access to cutting-edge experiences, enabling players to enjoy high-end titles on smartphones, tablets, and other internet-connected devices. This technology has the potential to reshape the industry’s economic models, reduce the barriers to entry, and allow for more seamless and instant access to a vast library of games. + +Despite its many successes, the video game industry has not been without controversy. Issues such as crunch culture, diversity and representation, loot boxes, and the impact of violent content have all sparked significant dialogue and debate amongst players, developers, and policymakers. The industry continues to grapple with these challenges as it seeks to balance innovation and growth with ethical considerations and social responsibility. Nevertheless, video games have established themselves as a powerful medium with the capacity to entertain, educate, and inspire in ways that are unique to the interactive nature of the medium. They offer immersive experiences that can transport players to fantastical worlds, tell complex stories, and provide social connections that transcend geographical boundaries. + +The evolution of video games is a testament to the creativity, ingenuity, and passion of both developers and players. From the early, pixelated days of "Pong" to the richly detailed, expansive virtual worlds of today, video games have continuously pushed the boundaries of technology and art. As the medium evolves, it will undoubtedly continue to break new ground, offering novel experiences and forging deeper connections between players. The future of video games is limited only by the imagination of those who create and play them, and it promises to be as dynamic and innovative as the history that has brought us to this point. + +In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games. + +As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time. + +As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi". +""" + + +if __name__ == "__main__": + MODEL_NAME = "nomic-ai/nomic-embed-text-v1.5" + tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased") + long_inputs = tokenizer(long_input, return_tensors="pt", padding=True) + num_tokens = long_inputs["input_ids"].shape + + print(f"Number of tokens in the input: {num_tokens}") + + hf_model = AutoModel.from_pretrained( + MODEL_NAME, + trust_remote_code=True, + safe_serialization=True, + revision="cd17e2bef4d704da4520e6bc4f92fe436af24d4c", + ) + + onnx_path = Path("tests/nomic_bert.onnx") + onnx_config_constructor = TasksManager.get_exporter_config_constructor( + "onnx", hf_model, task="feature-extraction", library_name="transformers" + ) + onnx_config = onnx_config_constructor(hf_model.config) + onnx_inputs, onnx_outputs = export(hf_model, onnx_config, onnx_path, onnx_config.DEFAULT_ONNX_OPSET) + + print("After export") + print(onnx_inputs) + print(onnx_outputs) + + onnx_model = onnx.load(onnx_path) + onnx.checker.check_model(onnx_model) + + validate_model_outputs(onnx_config, hf_model, onnx_path, onnx_outputs, onnx_config.ATOL_FOR_VALIDATION) + + model = ORTModelForFeatureExtraction.from_pretrained( + MODEL_NAME, + file_name="onnx/model.onnx", + trust_remote_code=True, + safe_serialization=True, + revision="cd17e2bef4d704da4520e6bc4f92fe436af24d4c", + ) + + print("Testing for longer sequence length for Nomic-AI model") + optimum_model_outputs = model(**long_inputs) + hf_model_outputs = hf_model(**long_inputs) + print( + "Are outputs from both models close when using longer texts?", + np.allclose( + optimum_model_outputs.last_hidden_state.cpu().detach().numpy(), + hf_model_outputs.last_hidden_state.cpu().detach().numpy(), + rtol=1e-3, + atol=1e-3, + ), + ) From 955fb1555518d0c6018c8fd8a68269d717a0e8f1 Mon Sep 17 00:00:00 2001 From: bhavika Date: Mon, 21 Oct 2024 08:58:30 -0400 Subject: [PATCH 28/28] Remove test file --- tests/nomic_bert.py | 166 -------------------------------------------- 1 file changed, 166 deletions(-) delete mode 100644 tests/nomic_bert.py diff --git a/tests/nomic_bert.py b/tests/nomic_bert.py deleted file mode 100644 index 01945b1a2f3..00000000000 --- a/tests/nomic_bert.py +++ /dev/null @@ -1,166 +0,0 @@ -import numpy as np -from transformers import AutoTokenizer, AutoModel -from pathlib import Path -from optimum.exporters import TasksManager -from optimum.exporters.onnx import export -import onnx -from optimum.exporters.onnx import validate_model_outputs -from optimum.onnxruntime import ORTModelForFeatureExtraction - - -long_input = """ -In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games. - -As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time. - -As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi" and later on "The Sims," expanding the scope of interactive entertainment beyond traditional genres. - -As technology continued to evolve, the late 1990s and early 2000s introduced another paradigm shift with the advent of 3D graphics. The fifth-generation consoles, such as the Sony PlayStation and the Nintendo 64, exploited this new capability to full effect, giving players the ability to navigate three-dimensional spaces and experience games in a novel, more immersive way. Titles such as "Super Mario 64" and "The Legend of Zelda: Ocarina of Time" became epitomes of how three-dimensional gameplay could revolutionize game design. These games offered expansive, open worlds to explore, seamlessly blending engaging mechanics with storytelling elements that gave players a sense of agency and exploration previously unattainable. The rise of 3D also heralded the beginning of cinematic storytelling in games, with titles like "Metal Gear Solid" incorporating voice acting, elaborate plots, and complex character development to create an experience akin to interactive films. - -The advent of the internet exponentially increased the reach and interactivity of video games, leading to the proliferation of massive multiplayer online games (MMOs) in the early 2000s. Titles like "World of Warcraft" created virtual worlds where millions of players could interact, cooperate, and compete in real-time. This evolution not only changed the way games were played but also formed communities that blurred the line between virtual and real worlds, creating social networks within the gaming ecosystem. The ability to play with and against others from across the globe added a new layer of engagement and longevity to the gaming experience. - -With the introduction of high-definition graphics in the mid-2000s, home consoles like the Xbox 360 and PlayStation 3 brought previously unseen levels of detail and realism to video games. This era saw the rise of popular franchises such as "Call of Duty" and "Assassin's Creed," which delivered cinematic experiences that rivaled blockbuster films. These games raised the bar for production values in terms of graphics, sound, and storytelling, creating immersive worlds that players could lose themselves in for hours on end. The emergence of digital distribution platforms like Steam also began to change the landscape of game publishing and distribution, allowing indie developers to bring innovative and unique games to the market without the backing of major publishers. This democratization of game development resulted in a broader diversity of gaming experiences, from small art-house projects to sprawling open-world epics. - -The advent of mobile gaming in the late 2000s introduced yet another seismic shift in how and where games were played. The ubiquity of smartphones brought gaming to a global audience that was previously untapped, making it an everyday activity accessible to anyone, anywhere. Casual games like "Angry Birds" and "Candy Crush Saga" became cultural phenomena, engaging a wider demographic and changing the public perception of what a video game could be. The success of mobile gaming has also led to the development of hybrid experiences, with many traditional video game franchises finding new life and audiences on mobile platforms. This era has also seen the rise of in-app purchases and microtransactions as a business model, influencing the design and monetization strategies of games across all platforms. - -Virtual reality (VR) and augmented reality (AR) technologies, though still in their relative infancy, represent the next frontier in video gaming. Devices like the Oculus Rift, HTC Vive, and PlayStation VR have begun to offer players completely immersive experiences, placing them directly within the game world. VR technology has the potential to transform not only gaming but also a host of other industries, from education to healthcare. AR games like "Pokémon GO" have demonstrated how blending the virtual with the real world can create unique and engaging experiences, bringing players together in communal activities focused on exploration and shared adventures. - -Esports has emerged as a significant cultural and economic force, with professional players and teams competing in tournaments with prize pools reaching millions of dollars. Games like "League of Legends," "Dota 2," and "Fortnite" have become global spectacles, attracting audiences that rival those of traditional sports. The rise of streaming platforms like Twitch has further facilitated the growth of esports, allowing players to build careers around broadcasting their gameplay to fans around the world. The convergence of gaming and social media has also enabled content creators and influencers to shape and drive gaming culture, blurring the lines between playing games and participating in a wider community. - -Cloud gaming represents another transformative trend, promising to revolutionize how games are accessed and played. Services like Google Stadia, Microsoft’s xCloud, and NVIDIA’s GeForce Now aim to make high-quality gaming accessible on a variety of devices without the need for powerful local hardware. By streaming games from remote servers, cloud gaming could democratize access to cutting-edge experiences, enabling players to enjoy high-end titles on smartphones, tablets, and other internet-connected devices. This technology has the potential to reshape the industry’s economic models, reduce the barriers to entry, and allow for more seamless and instant access to a vast library of games. - -Despite its many successes, the video game industry has not been without controversy. Issues such as crunch culture, diversity and representation, loot boxes, and the impact of violent content have all sparked significant dialogue and debate amongst players, developers, and policymakers. The industry continues to grapple with these challenges as it seeks to balance innovation and growth with ethical considerations and social responsibility. Nevertheless, video games have established themselves as a powerful medium with the capacity to entertain, educate, and inspire in ways that are unique to the interactive nature of the medium. They offer immersive experiences that can transport players to fantastical worlds, tell complex stories, and provide social connections that transcend geographical boundaries. - -The evolution of video games is a testament to the creativity, ingenuity, and passion of both developers and players. From the early, pixelated days of "Pong" to the richly detailed, expansive virtual worlds of today, video games have continuously pushed the boundaries of technology and art. As the medium evolves, it will undoubtedly continue to break new ground, offering novel experiences and forging deeper connections between players. The future of video games is limited only by the imagination of those who create and play them, and it promises to be as dynamic and innovative as the history that has brought us to this point. - -In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games. - -As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time. - -As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi" and later on "The Sims," expanding the scope of interactive entertainment beyond traditional genres. - -As technology continued to evolve, the late 1990s and early 2000s introduced another paradigm shift with the advent of 3D graphics. The fifth-generation consoles, such as the Sony PlayStation and the Nintendo 64, exploited this new capability to full effect, giving players the ability to navigate three-dimensional spaces and experience games in a novel, more immersive way. Titles such as "Super Mario 64" and "The Legend of Zelda: Ocarina of Time" became epitomes of how three-dimensional gameplay could revolutionize game design. These games offered expansive, open worlds to explore, seamlessly blending engaging mechanics with storytelling elements that gave players a sense of agency and exploration previously unattainable. The rise of 3D also heralded the beginning of cinematic storytelling in games, with titles like "Metal Gear Solid" incorporating voice acting, elaborate plots, and complex character development to create an experience akin to interactive films. - -The advent of the internet exponentially increased the reach and interactivity of video games, leading to the proliferation of massive multiplayer online games (MMOs) in the early 2000s. Titles like "World of Warcraft" created virtual worlds where millions of players could interact, cooperate, and compete in real-time. This evolution not only changed the way games were played but also formed communities that blurred the line between virtual and real worlds, creating social networks within the gaming ecosystem. The ability to play with and against others from across the globe added a new layer of engagement and longevity to the gaming experience. - -With the introduction of high-definition graphics in the mid-2000s, home consoles like the Xbox 360 and PlayStation 3 brought previously unseen levels of detail and realism to video games. This era saw the rise of popular franchises such as "Call of Duty" and "Assassin's Creed," which delivered cinematic experiences that rivaled blockbuster films. These games raised the bar for production values in terms of graphics, sound, and storytelling, creating immersive worlds that players could lose themselves in for hours on end. The emergence of digital distribution platforms like Steam also began to change the landscape of game publishing and distribution, allowing indie developers to bring innovative and unique games to the market without the backing of major publishers. This democratization of game development resulted in a broader diversity of gaming experiences, from small art-house projects to sprawling open-world epics. - -The advent of mobile gaming in the late 2000s introduced yet another seismic shift in how and where games were played. The ubiquity of smartphones brought gaming to a global audience that was previously untapped, making it an everyday activity accessible to anyone, anywhere. Casual games like "Angry Birds" and "Candy Crush Saga" became cultural phenomena, engaging a wider demographic and changing the public perception of what a video game could be. The success of mobile gaming has also led to the development of hybrid experiences, with many traditional video game franchises finding new life and audiences on mobile platforms. This era has also seen the rise of in-app purchases and microtransactions as a business model, influencing the design and monetization strategies of games across all platforms. - -Virtual reality (VR) and augmented reality (AR) technologies, though still in their relative infancy, represent the next frontier in video gaming. Devices like the Oculus Rift, HTC Vive, and PlayStation VR have begun to offer players completely immersive experiences, placing them directly within the game world. VR technology has the potential to transform not only gaming but also a host of other industries, from education to healthcare. AR games like "Pokémon GO" have demonstrated how blending the virtual with the real world can create unique and engaging experiences, bringing players together in communal activities focused on exploration and shared adventures. - -Esports has emerged as a significant cultural and economic force, with professional players and teams competing in tournaments with prize pools reaching millions of dollars. Games like "League of Legends," "Dota 2," and "Fortnite" have become global spectacles, attracting audiences that rival those of traditional sports. The rise of streaming platforms like Twitch has further facilitated the growth of esports, allowing players to build careers around broadcasting their gameplay to fans around the world. The convergence of gaming and social media has also enabled content creators and influencers to shape and drive gaming culture, blurring the lines between playing games and participating in a wider community. - -Cloud gaming represents another transformative trend, promising to revolutionize how games are accessed and played. Services like Google Stadia, Microsoft’s xCloud, and NVIDIA’s GeForce Now aim to make high-quality gaming accessible on a variety of devices without the need for powerful local hardware. By streaming games from remote servers, cloud gaming could democratize access to cutting-edge experiences, enabling players to enjoy high-end titles on smartphones, tablets, and other internet-connected devices. This technology has the potential to reshape the industry’s economic models, reduce the barriers to entry, and allow for more seamless and instant access to a vast library of games. - -Despite its many successes, the video game industry has not been without controversy. Issues such as crunch culture, diversity and representation, loot boxes, and the impact of violent content have all sparked significant dialogue and debate amongst players, developers, and policymakers. The industry continues to grapple with these challenges as it seeks to balance innovation and growth with ethical considerations and social responsibility. Nevertheless, video games have established themselves as a powerful medium with the capacity to entertain, educate, and inspire in ways that are unique to the interactive nature of the medium. They offer immersive experiences that can transport players to fantastical worlds, tell complex stories, and provide social connections that transcend geographical boundaries. - -The evolution of video games is a testament to the creativity, ingenuity, and passion of both developers and players. From the early, pixelated days of "Pong" to the richly detailed, expansive virtual worlds of today, video games have continuously pushed the boundaries of technology and art. As the medium evolves, it will undoubtedly continue to break new ground, offering novel experiences and forging deeper connections between players. The future of video games is limited only by the imagination of those who create and play them, and it promises to be as dynamic and innovative as the history that has brought us to this point. - -In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games. - -As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time. - -As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi" and later on "The Sims," expanding the scope of interactive entertainment beyond traditional genres. - -As technology continued to evolve, the late 1990s and early 2000s introduced another paradigm shift with the advent of 3D graphics. The fifth-generation consoles, such as the Sony PlayStation and the Nintendo 64, exploited this new capability to full effect, giving players the ability to navigate three-dimensional spaces and experience games in a novel, more immersive way. Titles such as "Super Mario 64" and "The Legend of Zelda: Ocarina of Time" became epitomes of how three-dimensional gameplay could revolutionize game design. These games offered expansive, open worlds to explore, seamlessly blending engaging mechanics with storytelling elements that gave players a sense of agency and exploration previously unattainable. The rise of 3D also heralded the beginning of cinematic storytelling in games, with titles like "Metal Gear Solid" incorporating voice acting, elaborate plots, and complex character development to create an experience akin to interactive films. - -The advent of the internet exponentially increased the reach and interactivity of video games, leading to the proliferation of massive multiplayer online games (MMOs) in the early 2000s. Titles like "World of Warcraft" created virtual worlds where millions of players could interact, cooperate, and compete in real-time. This evolution not only changed the way games were played but also formed communities that blurred the line between virtual and real worlds, creating social networks within the gaming ecosystem. The ability to play with and against others from across the globe added a new layer of engagement and longevity to the gaming experience. - -With the introduction of high-definition graphics in the mid-2000s, home consoles like the Xbox 360 and PlayStation 3 brought previously unseen levels of detail and realism to video games. This era saw the rise of popular franchises such as "Call of Duty" and "Assassin's Creed," which delivered cinematic experiences that rivaled blockbuster films. These games raised the bar for production values in terms of graphics, sound, and storytelling, creating immersive worlds that players could lose themselves in for hours on end. The emergence of digital distribution platforms like Steam also began to change the landscape of game publishing and distribution, allowing indie developers to bring innovative and unique games to the market without the backing of major publishers. This democratization of game development resulted in a broader diversity of gaming experiences, from small art-house projects to sprawling open-world epics. - -The advent of mobile gaming in the late 2000s introduced yet another seismic shift in how and where games were played. The ubiquity of smartphones brought gaming to a global audience that was previously untapped, making it an everyday activity accessible to anyone, anywhere. Casual games like "Angry Birds" and "Candy Crush Saga" became cultural phenomena, engaging a wider demographic and changing the public perception of what a video game could be. The success of mobile gaming has also led to the development of hybrid experiences, with many traditional video game franchises finding new life and audiences on mobile platforms. This era has also seen the rise of in-app purchases and microtransactions as a business model, influencing the design and monetization strategies of games across all platforms. - -Virtual reality (VR) and augmented reality (AR) technologies, though still in their relative infancy, represent the next frontier in video gaming. Devices like the Oculus Rift, HTC Vive, and PlayStation VR have begun to offer players completely immersive experiences, placing them directly within the game world. VR technology has the potential to transform not only gaming but also a host of other industries, from education to healthcare. AR games like "Pokémon GO" have demonstrated how blending the virtual with the real world can create unique and engaging experiences, bringing players together in communal activities focused on exploration and shared adventures. - -Esports has emerged as a significant cultural and economic force, with professional players and teams competing in tournaments with prize pools reaching millions of dollars. Games like "League of Legends," "Dota 2," and "Fortnite" have become global spectacles, attracting audiences that rival those of traditional sports. The rise of streaming platforms like Twitch has further facilitated the growth of esports, allowing players to build careers around broadcasting their gameplay to fans around the world. The convergence of gaming and social media has also enabled content creators and influencers to shape and drive gaming culture, blurring the lines between playing games and participating in a wider community. - -Cloud gaming represents another transformative trend, promising to revolutionize how games are accessed and played. Services like Google Stadia, Microsoft’s xCloud, and NVIDIA’s GeForce Now aim to make high-quality gaming accessible on a variety of devices without the need for powerful local hardware. By streaming games from remote servers, cloud gaming could democratize access to cutting-edge experiences, enabling players to enjoy high-end titles on smartphones, tablets, and other internet-connected devices. This technology has the potential to reshape the industry’s economic models, reduce the barriers to entry, and allow for more seamless and instant access to a vast library of games. - -Despite its many successes, the video game industry has not been without controversy. Issues such as crunch culture, diversity and representation, loot boxes, and the impact of violent content have all sparked significant dialogue and debate amongst players, developers, and policymakers. The industry continues to grapple with these challenges as it seeks to balance innovation and growth with ethical considerations and social responsibility. Nevertheless, video games have established themselves as a powerful medium with the capacity to entertain, educate, and inspire in ways that are unique to the interactive nature of the medium. They offer immersive experiences that can transport players to fantastical worlds, tell complex stories, and provide social connections that transcend geographical boundaries. - -The evolution of video games is a testament to the creativity, ingenuity, and passion of both developers and players. From the early, pixelated days of "Pong" to the richly detailed, expansive virtual worlds of today, video games have continuously pushed the boundaries of technology and art. As the medium evolves, it will undoubtedly continue to break new ground, offering novel experiences and forging deeper connections between players. The future of video games is limited only by the imagination of those who create and play them, and it promises to be as dynamic and innovative as the history that has brought us to this point. - -In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games. - -As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time. - -As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi" and later on "The Sims," expanding the scope of interactive entertainment beyond traditional genres. - -As technology continued to evolve, the late 1990s and early 2000s introduced another paradigm shift with the advent of 3D graphics. The fifth-generation consoles, such as the Sony PlayStation and the Nintendo 64, exploited this new capability to full effect, giving players the ability to navigate three-dimensional spaces and experience games in a novel, more immersive way. Titles such as "Super Mario 64" and "The Legend of Zelda: Ocarina of Time" became epitomes of how three-dimensional gameplay could revolutionize game design. These games offered expansive, open worlds to explore, seamlessly blending engaging mechanics with storytelling elements that gave players a sense of agency and exploration previously unattainable. The rise of 3D also heralded the beginning of cinematic storytelling in games, with titles like "Metal Gear Solid" incorporating voice acting, elaborate plots, and complex character development to create an experience akin to interactive films. - -The advent of the internet exponentially increased the reach and interactivity of video games, leading to the proliferation of massive multiplayer online games (MMOs) in the early 2000s. Titles like "World of Warcraft" created virtual worlds where millions of players could interact, cooperate, and compete in real-time. This evolution not only changed the way games were played but also formed communities that blurred the line between virtual and real worlds, creating social networks within the gaming ecosystem. The ability to play with and against others from across the globe added a new layer of engagement and longevity to the gaming experience. - -With the introduction of high-definition graphics in the mid-2000s, home consoles like the Xbox 360 and PlayStation 3 brought previously unseen levels of detail and realism to video games. This era saw the rise of popular franchises such as "Call of Duty" and "Assassin's Creed," which delivered cinematic experiences that rivaled blockbuster films. These games raised the bar for production values in terms of graphics, sound, and storytelling, creating immersive worlds that players could lose themselves in for hours on end. The emergence of digital distribution platforms like Steam also began to change the landscape of game publishing and distribution, allowing indie developers to bring innovative and unique games to the market without the backing of major publishers. This democratization of game development resulted in a broader diversity of gaming experiences, from small art-house projects to sprawling open-world epics. - -The advent of mobile gaming in the late 2000s introduced yet another seismic shift in how and where games were played. The ubiquity of smartphones brought gaming to a global audience that was previously untapped, making it an everyday activity accessible to anyone, anywhere. Casual games like "Angry Birds" and "Candy Crush Saga" became cultural phenomena, engaging a wider demographic and changing the public perception of what a video game could be. The success of mobile gaming has also led to the development of hybrid experiences, with many traditional video game franchises finding new life and audiences on mobile platforms. This era has also seen the rise of in-app purchases and microtransactions as a business model, influencing the design and monetization strategies of games across all platforms. - -Virtual reality (VR) and augmented reality (AR) technologies, though still in their relative infancy, represent the next frontier in video gaming. Devices like the Oculus Rift, HTC Vive, and PlayStation VR have begun to offer players completely immersive experiences, placing them directly within the game world. VR technology has the potential to transform not only gaming but also a host of other industries, from education to healthcare. AR games like "Pokémon GO" have demonstrated how blending the virtual with the real world can create unique and engaging experiences, bringing players together in communal activities focused on exploration and shared adventures. - -Esports has emerged as a significant cultural and economic force, with professional players and teams competing in tournaments with prize pools reaching millions of dollars. Games like "League of Legends," "Dota 2," and "Fortnite" have become global spectacles, attracting audiences that rival those of traditional sports. The rise of streaming platforms like Twitch has further facilitated the growth of esports, allowing players to build careers around broadcasting their gameplay to fans around the world. The convergence of gaming and social media has also enabled content creators and influencers to shape and drive gaming culture, blurring the lines between playing games and participating in a wider community. - -Cloud gaming represents another transformative trend, promising to revolutionize how games are accessed and played. Services like Google Stadia, Microsoft’s xCloud, and NVIDIA’s GeForce Now aim to make high-quality gaming accessible on a variety of devices without the need for powerful local hardware. By streaming games from remote servers, cloud gaming could democratize access to cutting-edge experiences, enabling players to enjoy high-end titles on smartphones, tablets, and other internet-connected devices. This technology has the potential to reshape the industry’s economic models, reduce the barriers to entry, and allow for more seamless and instant access to a vast library of games. - -Despite its many successes, the video game industry has not been without controversy. Issues such as crunch culture, diversity and representation, loot boxes, and the impact of violent content have all sparked significant dialogue and debate amongst players, developers, and policymakers. The industry continues to grapple with these challenges as it seeks to balance innovation and growth with ethical considerations and social responsibility. Nevertheless, video games have established themselves as a powerful medium with the capacity to entertain, educate, and inspire in ways that are unique to the interactive nature of the medium. They offer immersive experiences that can transport players to fantastical worlds, tell complex stories, and provide social connections that transcend geographical boundaries. - -The evolution of video games is a testament to the creativity, ingenuity, and passion of both developers and players. From the early, pixelated days of "Pong" to the richly detailed, expansive virtual worlds of today, video games have continuously pushed the boundaries of technology and art. As the medium evolves, it will undoubtedly continue to break new ground, offering novel experiences and forging deeper connections between players. The future of video games is limited only by the imagination of those who create and play them, and it promises to be as dynamic and innovative as the history that has brought us to this point. - -In the dimly-lit arcades of the 1970s, the cacophony of sounds emanating from the first video games was an early marker of an industry that, unbeknownst to many, would burgeon into one of the most influential forms of entertainment in modern history. As players lined up to test their mettle against the glowing screens, little did they know they were partaking in the genesis of an evolving medium that would touch billions of lives. The initial, humble incarnations of video games were simple in design and concept, often limited by the technology of the era, yet they were astonishingly innovative. Titles like "Pong," with its minimalist, two-dimensional graphics and simplistic gameplay, laid the groundwork for what would become a multifaceted and complex industry. The challenge and novelty of interacting with a virtual environment, even one as rudimentary as a bouncing ball on a black-and-white screen, captured the imagination of the masses and hinted at the expansive potential of video games. - -As the 1980s rolled in, the increased sophistication of hardware allowed for more intricate game designs and richly detailed narratives. This was the decade where characters and stories began to take center stage, giving rise to iconic figures like Mario and Link, heroes who would become household names. The Nintendo Entertainment System (NES) ushered in an era of home gaming, wresting control from the arcades and planting it firmly within living rooms. The concept of expanded worlds filled with adventure, such as those presented in "The Legend of Zelda," pushed the boundaries of what a video game could achieve, marrying gameplay with an emergent sense of story and discovery. The tactile nature of the controller, combined with the pixelated yet vibrant visuals on screen, offered an experience that was immersive and personal, making it distinct from any other form of media at the time. - -As the 1990s approached, the introduction of 16-bit consoles, exemplified by the Sega Genesis and the Super Nintendo, marked a significant leap in graphical fidelity and sound design. Games could now convey more complex stories and offer richer visual experiences, leading to a golden age of creativity and innovation. This period saw the birth of genre-defining titles like "Sonic the Hedgehog," which combined breathtaking speed with memorable level design, and "Final Fantasy VI," a game that showcased the potential for video games to deliver epic narratives and emotional depth. The battle between Sega and Nintendo during this era spurred rapid advancements in technology and game design, a competitive spirit that benefited gamers with a plethora of high-quality titles to choose from. The resurgence of arcades was also notable, with fighting games like "Street Fighter II" and "Mortal Kombat" drawing crowds with their intense, competitive gameplay and colorful, often controversial characters. This decade also saw the advent of digital pets and life simulation games like "Tamagotchi". -""" - - -if __name__ == "__main__": - MODEL_NAME = "nomic-ai/nomic-embed-text-v1.5" - tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased") - long_inputs = tokenizer(long_input, return_tensors="pt", padding=True) - num_tokens = long_inputs["input_ids"].shape - - print(f"Number of tokens in the input: {num_tokens}") - - hf_model = AutoModel.from_pretrained( - MODEL_NAME, - trust_remote_code=True, - safe_serialization=True, - revision="cd17e2bef4d704da4520e6bc4f92fe436af24d4c", - ) - - onnx_path = Path("tests/nomic_bert.onnx") - onnx_config_constructor = TasksManager.get_exporter_config_constructor( - "onnx", hf_model, task="feature-extraction", library_name="transformers" - ) - onnx_config = onnx_config_constructor(hf_model.config) - onnx_inputs, onnx_outputs = export(hf_model, onnx_config, onnx_path, onnx_config.DEFAULT_ONNX_OPSET) - - print("After export") - print(onnx_inputs) - print(onnx_outputs) - - onnx_model = onnx.load(onnx_path) - onnx.checker.check_model(onnx_model) - - validate_model_outputs(onnx_config, hf_model, onnx_path, onnx_outputs, onnx_config.ATOL_FOR_VALIDATION) - - model = ORTModelForFeatureExtraction.from_pretrained( - MODEL_NAME, - file_name="onnx/model.onnx", - trust_remote_code=True, - safe_serialization=True, - revision="cd17e2bef4d704da4520e6bc4f92fe436af24d4c", - ) - - print("Testing for longer sequence length for Nomic-AI model") - optimum_model_outputs = model(**long_inputs) - hf_model_outputs = hf_model(**long_inputs) - print( - "Are outputs from both models close when using longer texts?", - np.allclose( - optimum_model_outputs.last_hidden_state.cpu().detach().numpy(), - hf_model_outputs.last_hidden_state.cpu().detach().numpy(), - rtol=1e-3, - atol=1e-3, - ), - )