[en] This paper proposes a novel architecture with a framework that dynamically activates the optimal number of radio frequency (RF) chains used to implement hybrid beamforming in a millimeter wave (mmWave) multiple-input and multiple-output (MIMO) system. We use fractional programming to solve an energy efficiency maximization problem and exploit the Dinkelbach method (DM)-based framework to optimize the number of active RF chains and data streams. This solution is updated dynamically based on the current channel conditions, where the analog/digital (A/D) hybrid precoder and combiner matrices at the transmitter and the receiver, respectively, are designed using a codebook-based fast approximation solution called gradient pursuit (GP). The GP algorithm shows less run time and complexity while compared to the state-of-the-art orthogonal matching pursuit (OMP) solution. The energy and spectral efficiency performance of the proposed framework is compared with the existing state-of-the-art solutions, such as the brute force (BF), the digital beamformer, and the analog beamformer. The codebook-free approaches to design the precoders and combiners, such as alternating direction method of multipliers (ADMMs) and singular value decomposition (SVD)-based solution are also shown to be incorporated into the proposed framework to achieve better energy efficiency performance.